ErrorHandlerBuilderTest::testGetExceptionLevel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Graze\Monolog;
4
5
use PHPUnit\Framework\TestCase;
6
use Psr\Log\LogLevel;
7
8
class ErrorHandlerBuilderTest extends TestCase
9
{
10
    public function setUp()
11
    {
12
        $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...
13
    }
14
15
    public function testGetErrorLevelMap()
16
    {
17
        $this->assertSame([], $this->builder->getErrorLevelMap());
18
    }
19
20
    public function testSetErrorLevelMap()
21
    {
22
        $map = ['foo' => 'bar'];
23
24
        $this->builder->setErrorLevelMap($map);
25
        $this->assertSame($map, $this->builder->getErrorLevelMap());
26
    }
27
28
    public function testGetExceptionLevel()
29
    {
30
        $this->assertSame(LogLevel::CRITICAL, $this->builder->getExceptionLevel());
31
    }
32
33
    public function testSetExceptionLevel()
34
    {
35
        $this->builder->setExceptionLevel('foo');
36
        $this->assertSame('foo', $this->builder->getExceptionLevel());
37
    }
38
39
    public function testGetFatalLevel()
40
    {
41
        $this->assertNull($this->builder->getFatalLevel());
42
    }
43
44
    public function testSetFatalLevel()
45
    {
46
        $this->builder->setFatalLevel('foo');
47
        $this->assertSame('foo', $this->builder->getFatalLevel());
48
    }
49
}
50