7
7
use PHPUnit \Framework \Attributes \DataProvider ;
8
8
use function sprintf ;
9
9
10
- class GitlabFormatterTest extends ErrorFormatterTestCase
10
+ class GitlabErrorFormatterTest extends ErrorFormatterTestCase
11
11
{
12
12
13
13
public static function dataFormatterOutputProvider (): iterable
@@ -28,6 +28,7 @@ public static function dataFormatterOutputProvider(): iterable
28
28
'[
29
29
{
30
30
"description": "Foo",
31
+ "check_name": null,
31
32
"fingerprint": "e82b7e1f1d4255352b19ecefa9116a12f129c7edb4351cf2319285eccdb1565e",
32
33
"severity": "major",
33
34
"location": {
@@ -68,6 +69,7 @@ public static function dataFormatterOutputProvider(): iterable
68
69
'[
69
70
{
70
71
"description": "Bar\nBar2",
72
+ "check_name": null,
71
73
"fingerprint": "034b4afbfb347494c14e396ed8327692f58be4cd27e8aff5f19f4194934db7c9",
72
74
"severity": "major",
73
75
"location": {
@@ -79,6 +81,7 @@ public static function dataFormatterOutputProvider(): iterable
79
81
},
80
82
{
81
83
"description": "Foo",
84
+ "check_name": null,
82
85
"fingerprint": "e82b7e1f1d4255352b19ecefa9116a12f129c7edb4351cf2319285eccdb1565e",
83
86
"severity": "major",
84
87
"location": {
@@ -90,6 +93,7 @@ public static function dataFormatterOutputProvider(): iterable
90
93
},
91
94
{
92
95
"description": "Foo<Bar>",
96
+ "check_name": null,
93
97
"fingerprint": "d7002959fc192c81d51fc41b0a3f240617a1aa35361867b5e924ae8d7fec39cb",
94
98
"severity": "major",
95
99
"location": {
@@ -101,6 +105,7 @@ public static function dataFormatterOutputProvider(): iterable
101
105
},
102
106
{
103
107
"description": "Bar\nBar2",
108
+ "check_name": null,
104
109
"fingerprint": "829f6c782152fdac840b39208c5b519d18e51bff2c601b6197812fffb8bcd9ed",
105
110
"severity": "major",
106
111
"location": {
@@ -121,6 +126,7 @@ public static function dataFormatterOutputProvider(): iterable
121
126
'[
122
127
{
123
128
"description": "Bar\nBar2",
129
+ "check_name": null,
124
130
"fingerprint": "034b4afbfb347494c14e396ed8327692f58be4cd27e8aff5f19f4194934db7c9",
125
131
"severity": "major",
126
132
"location": {
@@ -132,6 +138,7 @@ public static function dataFormatterOutputProvider(): iterable
132
138
},
133
139
{
134
140
"description": "Foo",
141
+ "check_name": null,
135
142
"fingerprint": "e82b7e1f1d4255352b19ecefa9116a12f129c7edb4351cf2319285eccdb1565e",
136
143
"severity": "major",
137
144
"location": {
@@ -143,6 +150,7 @@ public static function dataFormatterOutputProvider(): iterable
143
150
},
144
151
{
145
152
"description": "Bar\nBar2",
153
+ "check_name": null,
146
154
"fingerprint": "52d22d9e64bd6c6257b7a0d170ed8c99482043aeedd68c52bac081a80da9800a",
147
155
"severity": "major",
148
156
"location": {
@@ -154,6 +162,7 @@ public static function dataFormatterOutputProvider(): iterable
154
162
},
155
163
{
156
164
"description": "Foo<Bar>",
165
+ "check_name": null,
157
166
"fingerprint": "d7002959fc192c81d51fc41b0a3f240617a1aa35361867b5e924ae8d7fec39cb",
158
167
"severity": "major",
159
168
"location": {
@@ -165,6 +174,7 @@ public static function dataFormatterOutputProvider(): iterable
165
174
},
166
175
{
167
176
"description": "Bar\nBar2",
177
+ "check_name": null,
168
178
"fingerprint": "829f6c782152fdac840b39208c5b519d18e51bff2c601b6197812fffb8bcd9ed",
169
179
"severity": "major",
170
180
"location": {
@@ -216,6 +226,7 @@ public static function dataFormatterOutputProvider(): iterable
216
226
'[
217
227
{
218
228
"description": "Bar\nBar2",
229
+ "check_name": null,
219
230
"fingerprint": "034b4afbfb347494c14e396ed8327692f58be4cd27e8aff5f19f4194934db7c9",
220
231
"severity": "major",
221
232
"location": {
@@ -227,6 +238,7 @@ public static function dataFormatterOutputProvider(): iterable
227
238
},
228
239
{
229
240
"description": "Foo",
241
+ "check_name": null,
230
242
"fingerprint": "e82b7e1f1d4255352b19ecefa9116a12f129c7edb4351cf2319285eccdb1565e",
231
243
"severity": "major",
232
244
"location": {
@@ -238,6 +250,7 @@ public static function dataFormatterOutputProvider(): iterable
238
250
},
239
251
{
240
252
"description": "Foo<Bar>",
253
+ "check_name": null,
241
254
"fingerprint": "d7002959fc192c81d51fc41b0a3f240617a1aa35361867b5e924ae8d7fec39cb",
242
255
"severity": "major",
243
256
"location": {
@@ -249,6 +262,7 @@ public static function dataFormatterOutputProvider(): iterable
249
262
},
250
263
{
251
264
"description": "Bar\nBar2",
265
+ "check_name": null,
252
266
"fingerprint": "829f6c782152fdac840b39208c5b519d18e51bff2c601b6197812fffb8bcd9ed",
253
267
"severity": "major",
254
268
"location": {
@@ -280,15 +294,39 @@ public static function dataFormatterOutputProvider(): iterable
280
294
}
281
295
}
282
296
}
297
+ ] ' ,
298
+ ];
299
+
300
+ yield [
301
+ 'File error with identifier ' ,
302
+ 1 ,
303
+ [5 , 1 ],
304
+ 0 ,
305
+ '[
306
+ {
307
+ "description": "Foobar \\\\Buz",
308
+ "check_name": "foobar.buz",
309
+ "fingerprint": "5543f2fd4c455f26c1500342ec5045b08c99b7827ab35595151dd6e7715c079c",
310
+ "severity": "major",
311
+ "location": {
312
+ "path": "with space/and unicode \ud83d\ude03/project/foo.php",
313
+ "lines": {
314
+ "begin": 5
315
+ }
316
+ }
317
+ }
283
318
] ' ,
284
319
];
285
320
}
286
321
322
+ /**
323
+ * @param array{int, int}|int $numFileErrors
324
+ */
287
325
#[DataProvider('dataFormatterOutputProvider ' )]
288
326
public function testFormatErrors (
289
327
string $ message ,
290
328
int $ exitCode ,
291
- int $ numFileErrors ,
329
+ array | int $ numFileErrors ,
292
330
int $ numGenericErrors ,
293
331
string $ expected ,
294
332
): void
0 commit comments