| 1 | <?php declare(strict_types = 1); |
||
| 3 | class ErrorHandlerLoggerTest extends PHPUnit_Framework_TestCase |
||
| 4 | { |
||
| 5 | |||
| 6 | public function tearDown() |
||
| 7 | { |
||
| 8 | Mockery::close(); |
||
| 9 | } |
||
| 10 | |||
| 11 | public function testHandle() |
||
| 12 | { |
||
| 13 | $exception = new Exception('Message'); |
||
| 14 | $logger = \Mockery::mock(\Psr\Log\LoggerInterface::class); |
||
| 15 | $logger->shouldReceive('log')->once()->with(\Psr\Log\LogLevel::ERROR, 'Message', ['exception' => $exception]); |
||
| 16 | $handler = new \Venta\Framework\ErrorHandler\ErrorHandlerLogger($logger); |
||
| 17 | $handler->setException($exception); |
||
| 18 | $result = $handler->handle(); |
||
| 19 | $this->assertSame($handler::DONE, $result); |
||
| 20 | } |
||
| 21 | |||
| 22 | } |