Passed
Branch master (e8fd46)
by Alexey
03:15
created

ErrorHandlerLoggerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 5
1
<?php declare(strict_types = 1);
2
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
}