Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
13 | class JsonTest extends TestCase |
||
14 | { |
||
15 | public function testInvalidJsonValidate(): void |
||
16 | { |
||
17 | $val = new Json(); |
||
18 | $this->assertFalse($val->validate('{"name": "tester"')->isValid()); |
||
19 | $this->assertFalse($val->validate('{"name": tester}')->isValid()); |
||
20 | } |
||
21 | |||
22 | public function testInvalidTypeValidate(): void |
||
28 | } |
||
29 | |||
30 | public function testValidValueValidate(): void |
||
33 | } |
||
34 | |||
35 | public function testValidationMessage(): void |
||
36 | { |
||
37 | $this->assertEquals( |
||
38 | [ |
||
39 | 'The value is not JSON.' |
||
40 | ], |
||
41 | (new Json())->validate('')->getErrors() |
||
42 | ); |
||
43 | } |
||
44 | |||
45 | public function testCustomValidationMessage(): void |
||
52 | ); |
||
53 | } |
||
55 |