Skip to content

Commit 7b23d2c

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2 parents 88d04da + 521da92 commit 7b23d2c

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎psalm-baseline.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9582,7 +9582,7 @@
95829582
<code><![CDATA[$filesInfos]]></code>
95839583
</MixedAssignment>
95849584
<PossiblyUndefinedArrayOffset>
9585-
<code><![CDATA[$filesFound[0]['exception']]]></code>
9585+
<code><![CDATA[$filesFound[1]['exception']]]></code>
95869586
</PossiblyUndefinedArrayOffset>
95879587
</file>
95889588
<file src="tests/unit/Config/ConfigFileTest.php">

‎tests/unit/Command/TwigLintCommandTest.php‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symfony\Component\Console\Command\Command;
1212
use Twig\Error\SyntaxError;
1313

14+
use function array_multisort;
1415
use function class_exists;
1516
use function sort;
1617

@@ -90,17 +91,18 @@ public function testGetFilesInfoInvalidFile(): void
9091
$filesFound = $twigLintCommand->getFilesInfo($path);
9192

9293
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'];
97101
self::assertInstanceOf(SyntaxError::class, $exception);
98102
self::assertSame(
99103
'Unexpected "}" in "' . $path . DIRECTORY_SEPARATOR . 'foo-invalid.twig" at line 1.',
100104
$exception->getMessage(),
101105
);
102-
self::assertSame('{{ file }}' . "\n", $filesFound[1]['template']);
103-
self::assertSame($path . DIRECTORY_SEPARATOR . 'foo-valid.twig', $filesFound[1]['file']);
104106
}
105107

106108
public function testGetContext(): void

0 commit comments

Comments
 (0)