Total Complexity | 3 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | class SplBoolTest extends TestCase |
||
20 | { |
||
21 | /** |
||
22 | * Unit test. |
||
23 | * |
||
24 | * @return void |
||
25 | */ |
||
26 | public function test(): void |
||
27 | { |
||
28 | $instance = new DuckBool(); |
||
29 | $this->assertFalse($instance()); |
||
30 | |||
31 | $instance = new DuckBool(true); |
||
32 | $this->assertTrue($instance()); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Unit test. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | public function testGetConstList(): void |
||
41 | { |
||
42 | $list = [ |
||
43 | '__default' => false, |
||
44 | 'false' => false, |
||
45 | 'true' => true, |
||
46 | ]; |
||
47 | $instance = new DuckBool(); |
||
48 | |||
49 | $test = $instance->getConstList(true); |
||
50 | $this->assertSame($list, $test); |
||
51 | |||
52 | $test = $instance->getConstList(); |
||
53 | unset($list['__default']); |
||
54 | $this->assertSame($list, $test); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Unit test. |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | public function testSerialization(): void |
||
70 | } |
||
71 | } |
||
72 |