Skip to content

Commit

Permalink
[TASK] Canonicalize arrays before comparison (TYPO3#422)
Browse files Browse the repository at this point in the history
Fixes a sometimes failing, sometimes succeeding unit
test which compares arrays of resolved files.

Sorts both arrays before comparison because at this
point in tests we don’t care about the order, which is
tested by other methods.

Unblocks TYPO3#421
  • Loading branch information
NamelessCoder authored and mbrodala committed Dec 6, 2018
1 parent 60545b6 commit 425b5c7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/Unit/View/TemplatePathsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,16 @@ public function testResolveFilesInFolders()
$instance,
[['examples/Resources/Private/Layouts/', 'examples/Resources/Private/Templates/Default/'], 'html']
);
$expected = [
'examples/Resources/Private/Layouts/Default.html',
'examples/Resources/Private/Layouts/Dynamic.html',
'examples/Resources/Private/Templates/Default/Default.html',
'examples/Resources/Private/Templates/Default/Nested/Default.html',
];
sort($result);
sort($expected);
$this->assertEquals(
[
'examples/Resources/Private/Layouts/Default.html',
'examples/Resources/Private/Layouts/Dynamic.html',
'examples/Resources/Private/Templates/Default/Default.html',
'examples/Resources/Private/Templates/Default/Nested/Default.html',
],
$expected,
$result
);
}
Expand Down

0 comments on commit 425b5c7

Please sign in to comment.