@@ -56,22 +56,24 @@ public function testWrite(): void
56
56
57
57
$ expected = [
58
58
'errors ' => [
59
- ['description ' => 'foo ' ,'path ' =>null ,'line ' =>null ,'column ' =>null ],
60
- ['description ' => 'bar ' ,'path ' =>null ,'line ' =>null ,'column ' =>null ],
61
- ['description ' => 'baz ' ,'path ' => 'baz-file.php ' ,'line ' =>null ,'column ' =>null ],
62
- ['description ' => 'tab ' ,'path ' => 'tab-file.php ' ,'line ' =>5 ,'column ' =>null ],
63
- ['description ' => 'taz ' ,'path ' => 'taz-file.php ' ,'line ' =>6 ,'column ' =>15 ],
64
- ['description ' => 'tar ' ,'path ' => 'tar-file.php ' ,'line ' =>-1 ,'column ' =>-1 ],
65
- ['description ' => 'file-in-checked-out-dir ' ,'path ' => 'subpath/file-in-checked-out-dir.php ' ,'line ' =>10 ,'column ' =>20 ],
59
+ ['description ' => 'foo ' , 'path ' =>null , 'line ' =>null , 'column ' =>null ],
60
+ ['description ' => 'bar ' , 'path ' =>null , 'line ' =>null , 'column ' =>null ],
61
+ ['description ' => 'baz ' , 'path ' => 'baz-file.php ' , 'line ' =>null , 'column ' =>null ],
62
+ ['description ' => 'tab ' , 'path ' => 'tab-file.php ' , 'line ' =>5 , 'column ' =>null ],
63
+ ['description ' => 'taz ' , 'path ' => 'taz-file.php ' , 'line ' =>6 , 'column ' =>15 ],
64
+ ['description ' => 'tar ' , 'path ' => 'tar-file.php ' , 'line ' =>-1 , 'column ' =>-1 ],
65
+ ['description ' => 'file-in-checked-out-dir ' , 'path ' => 'subpath/file-in-checked-out-dir.php ' , 'line ' =>10 , 'column ' =>20 ],
66
66
]
67
67
];
68
68
69
69
$ result = $ output ->fetch ();
70
+ self ::assertJson ($ result );
71
+
70
72
$ data = json_decode (trim ($ result ), true );
71
- $ this -> assertIsArray ($ data );
72
- $ this -> assertEquals ($ expected , $ data );
73
+ self :: assertIsArray ($ data );
74
+ self :: assertEquals ($ expected , $ data );
73
75
74
- self ::assertEquals (
76
+ self ::assertJsonStringEqualsJsonString (
75
77
<<<'OUTPUT'
76
78
{"errors":[{"description":"foo","path":null,"line":null,"column":null},{"description":"bar","path":null,"line":null,"column":null},{"description":"baz","path":"baz-file.php","line":null,"column":null},{"description":"tab","path":"tab-file.php","line":5,"column":null},{"description":"taz","path":"taz-file.php","line":6,"column":15},{"description":"tar","path":"tar-file.php","line":-1,"column":-1},{"description":"file-in-checked-out-dir","path":"subpath\/file-in-checked-out-dir.php","line":10,"column":20}]}
77
79
0 commit comments