Passed
Push — master ( ddd97a...25aa58 )
by Harry
06:46
created

ErrorHandlerBuilderTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetErrorLevelMap() 0 6 1
A testGetExceptionLevel() 0 3 1
A setUp() 0 3 1
A testSetExceptionLevel() 0 4 1
A testSetFatalLevel() 0 4 1
A testGetErrorLevelMap() 0 3 1
A testGetFatalLevel() 0 3 1
1
<?php
2
namespace Graze\Monolog;
3
4
use Mockery as m;
5
use Psr\Log\LogLevel;
6
7
class ErrorHandlerBuilderTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function setUp()
10
    {
11
        $this->builder = new ErrorHandlerBuilder();
0 ignored issues
show
Bug Best Practice introduced by
The property builder does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
12
    }
13
14
    public function testGetErrorLevelMap()
15
    {
16
        $this->assertSame(array(), $this->builder->getErrorLevelMap());
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
17
    }
18
19
    public function testSetErrorLevelMap()
20
    {
21
        $map = array('foo' => 'bar');
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
22
23
        $this->builder->setErrorLevelMap($map);
24
        $this->assertSame($map, $this->builder->getErrorLevelMap());
25
    }
26
27
    public function testGetExceptionLevel()
28
    {
29
        $this->assertSame(LogLevel::CRITICAL, $this->builder->getExceptionLevel());
30
    }
31
32
    public function testSetExceptionLevel()
33
    {
34
        $this->builder->setExceptionLevel('foo');
35
        $this->assertSame('foo', $this->builder->getExceptionLevel());
36
    }
37
38
    public function testGetFatalLevel()
39
    {
40
        $this->assertNull($this->builder->getFatalLevel());
41
    }
42
43
    public function testSetFatalLevel()
44
    {
45
        $this->builder->setFatalLevel('foo');
46
        $this->assertSame('foo', $this->builder->getFatalLevel());
47
    }
48
}
49