Conditions | 1 |
Paths | 1 |
Total Lines | 42 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function testFailedOutput() |
||
21 | { |
||
22 | $output = new Phpcs(); |
||
23 | ob_start(); |
||
24 | $output->output($this->getFailing(), 80, 100); |
||
25 | $report = ob_get_clean(); |
||
26 | $expected = '{ |
||
27 | "files": |
||
28 | {"file1.php": |
||
29 | {"messages":[ |
||
30 | { |
||
31 | "message":"Line 10 has an error", |
||
32 | "line": 10, |
||
33 | "type":"ERROR", |
||
34 | "column":1, |
||
35 | "fixable":"false", |
||
36 | "severity":1, |
||
37 | "source":"diffFilter" |
||
38 | } |
||
39 | ], |
||
40 | "errors":1, |
||
41 | "warnings":0 |
||
42 | } |
||
43 | , |
||
44 | "file2.php": |
||
45 | {"messages":[ |
||
46 | { |
||
47 | "message":"Line 15 has another error", |
||
48 | "line": 15, |
||
49 | "type":"ERROR", |
||
50 | "column":1, |
||
51 | "fixable":"false", |
||
52 | "severity":1, |
||
53 | "source":"diffFilter" |
||
54 | } |
||
55 | ], |
||
56 | "errors":1, |
||
57 | "warnings":0 |
||
58 | } |
||
59 | }, |
||
60 | "totals":{"errors":2,"fixable":0,"warnings":0}}'; |
||
61 | $this->assertJsonStringEqualsJsonString($expected, $report); |
||
62 | } |
||
64 |