Total Complexity | 2 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class LogConstructorTest extends TestCase |
||
9 | { |
||
10 | public function test_construction_with_config_array() |
||
11 | { |
||
12 | $log = new Log([ |
||
13 | 'timezone' => 'Europe/Berlin', |
||
14 | 'dateformat' => 'Y-m-d', |
||
15 | 'loggers' => [ |
||
16 | ['class' => Memory::class, 'levels' => Log::ALERT | Log::ERROR, 'format' => '[levelname] message'] |
||
17 | ] |
||
18 | ]); |
||
19 | |||
20 | $this->assertAttributeSame('Y-m-d', 'dateFormat', $log); |
||
21 | $this->assertAttributeSame('Europe/Berlin', 'timezone', $log); |
||
22 | } |
||
23 | |||
24 | public function test_construction_without_config() |
||
25 | { |
||
26 | $log = new Log([]); |
||
27 | |||
28 | $this->assertAttributeSame(false, 'deferred', $log); |
||
29 | $this->assertAttributeSame('d/m/Y H:i:s.u', 'dateFormat', $log); |
||
30 | $this->assertAttributeSame('UTC', 'timezone', $log); |
||
31 | } |
||
32 | } |
||
33 |