|
11 | 11 | use Symfony\Component\Console\Command\Command; |
12 | 12 | use Twig\Error\SyntaxError; |
13 | 13 |
|
| 14 | +use function array_multisort; |
14 | 15 | use function class_exists; |
15 | 16 | use function sort; |
16 | 17 |
|
@@ -90,17 +91,18 @@ public function testGetFilesInfoInvalidFile(): void |
90 | 91 | $filesFound = $twigLintCommand->getFilesInfo($path); |
91 | 92 |
|
92 | 93 | self::assertCount(2, $filesFound); |
93 | | - self::assertSame('{{ file }' . "\n", $filesFound[0]['template']); |
94 | | - self::assertSame($path . DIRECTORY_SEPARATOR . 'foo-invalid.twig', $filesFound[0]['file']); |
95 | | - self::assertArrayHasKey('exception', $filesFound[0]); |
96 | | - $exception = $filesFound[0]['exception']; |
| 94 | + array_multisort($filesFound); |
| 95 | + self::assertSame('{{ file }}' . "\n", $filesFound[0]['template']); |
| 96 | + self::assertSame($path . DIRECTORY_SEPARATOR . 'foo-valid.twig', $filesFound[0]['file']); |
| 97 | + self::assertSame('{{ file }' . "\n", $filesFound[1]['template']); |
| 98 | + self::assertSame($path . DIRECTORY_SEPARATOR . 'foo-invalid.twig', $filesFound[1]['file']); |
| 99 | + self::assertArrayHasKey('exception', $filesFound[1]); |
| 100 | + $exception = $filesFound[1]['exception']; |
97 | 101 | self::assertInstanceOf(SyntaxError::class, $exception); |
98 | 102 | self::assertSame( |
99 | 103 | 'Unexpected "}" in "' . $path . DIRECTORY_SEPARATOR . 'foo-invalid.twig" at line 1.', |
100 | 104 | $exception->getMessage(), |
101 | 105 | ); |
102 | | - self::assertSame('{{ file }}' . "\n", $filesFound[1]['template']); |
103 | | - self::assertSame($path . DIRECTORY_SEPARATOR . 'foo-valid.twig', $filesFound[1]['file']); |
104 | 106 | } |
105 | 107 |
|
106 | 108 | public function testGetContext(): void |
|
0 commit comments