|
8 | 8 | use PHPUnit\Framework\Attributes\DataProvider; |
9 | 9 | use stdClass; |
10 | 10 | use function array_merge; |
11 | | -use function array_shift; |
12 | 11 | use function define; |
13 | 12 | use function dirname; |
14 | 13 | use function implode; |
@@ -270,23 +269,24 @@ public function testFile(string $file): void |
270 | 269 | $failures = []; |
271 | 270 |
|
272 | 271 | foreach ($asserts as $args) { |
273 | | - $assertType = array_shift($args); |
274 | | - $file = array_shift($args); |
| 272 | + if ($args[0] === 'type') { |
| 273 | + $file = $args[1]; |
275 | 274 |
|
276 | | - if ($assertType === 'type') { |
277 | | - $expected = $args[0]; |
278 | | - $actual = $args[1]; |
| 275 | + $expected = $args[2]; |
| 276 | + $actual = $args[3]; |
279 | 277 |
|
280 | 278 | if ($expected !== $actual) { |
281 | | - $failures[] = sprintf("Line %d:\nExpected: %s\nActual: %s\n", $args[2], $expected, $actual); |
| 279 | + $failures[] = sprintf("Line %d:\nExpected: %s\nActual: %s\n", $args[4], $expected, $actual); |
282 | 280 | } |
283 | | - } elseif ($assertType === 'variableCertainty') { |
284 | | - $expectedCertainty = $args[0]; |
285 | | - $actualCertainty = $args[1]; |
286 | | - $variableName = $args[2]; |
| 281 | + } elseif ($args[0] === 'variableCertainty') { |
| 282 | + $file = $args[1]; |
| 283 | + |
| 284 | + $expectedCertainty = $args[2]; |
| 285 | + $actualCertainty = $args[3]; |
| 286 | + $variableName = $args[4]; |
287 | 287 |
|
288 | 288 | if ($expectedCertainty->equals($actualCertainty) !== true) { |
289 | | - $failures[] = sprintf("Certainty of %s on line %d:\nExpected: %s\nActual: %s\n", $variableName, $args[3], $expectedCertainty->describe(), $actualCertainty->describe()); |
| 289 | + $failures[] = sprintf("Certainty of %s on line %d:\nExpected: %s\nActual: %s\n", $variableName, $args[5], $expectedCertainty->describe(), $actualCertainty->describe()); |
290 | 290 | } |
291 | 291 | } |
292 | 292 | } |
|
0 commit comments