/** * @test */ public function dispatchFailedIsLogged() { $command = $this->getMockBuilder(Command::class)->getMock(); $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $logger->expects(self::once())->method('error'); $commandLogger = new CommandLogger($logger); $commandLogger->onDispatchFailed($command, new \Exception('Something is wrong.')); }
/** * @param Command $command * @param \Exception $exception * @return void */ public function onDispatchFailed(Command $command, \Exception $exception) { $this->logger->onDispatchFailed($command, $exception); }