Passed
Pull Request — master (#2)
by Mihail
03:21
created

DefaultProcessorPropertiesTest::test_defaults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Koded\Logging\Processors;
4
5
use Koded\Logging\Logger;
6
use PHPUnit\Framework\TestCase;
7
8
class DefaultProcessorPropertiesTest extends TestCase
9
{
10
    public function test_defaults()
11
    {
12
        $processor = new Memory([]);
13
14
        $this->assertAttributeSame(-1, 'levels', $processor);
15
        $this->assertAttributeSame('timestamp [levelname]: message', 'format', $processor);
16
        $this->assertAttributeSame('', 'formatted', $processor);
17
    }
18
19
    public function test_constructor_settings()
20
    {
21
        $processor = new Memory([
22
            'levels' => Logger::ALERT | Logger::NOTICE | Logger::WARNING,
23
            'format' => '[level] message'
24
        ]);
25
26
        $this->assertSame(50, $processor->levels());
27
        $this->assertAttributeSame('[level] message', 'format', $processor);
28
    }
29
}
30