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

DefaultProcessorPropertiesTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 20
rs 10
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