logger = $this->getMockBuilder( '\Psr\Log\LoggerInterface' ) ->disableOriginalConstructor() ->getMock(); } public function testCanConstruct() { $this->assertInstanceOf( Logger::class, new Logger( $this->logger ) ); } /** * @dataProvider logProvider */ public function testLog( $role, $message, $context ) { $this->logger->expects( $this->once() ) ->method( 'log' ); $instance = new Logger( $this->logger, $role ); $instance->log( 'Foo', $message, $context ); } public function logProvider() { yield [ Logger::ROLE_DEVELOPER, 'Foo', [ 'Foo' ] ]; yield [ Logger::ROLE_DEVELOPER, 'Foo', [ 'Foo', [ 'Bar' => 123 ] ] ]; } }