Skip to content

Commit 50ab771

Browse files
committed
F
1 parent e0fa7b8 commit 50ab771

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/Core/Ruleset/ExpandSniffDirectoryTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,18 @@ public function testExpandSniffDirectory()
5959
*/
6060

6161
$expectedSniffCodes = [
62+
'.Sniffs.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\IncorrectLevelShouldStillBeFoundSniff',
6263
'MyStandard.CategoryA.FindMe' => 'MyStandard\\Sniffs\\CategoryA\\FindMeSniff',
63-
'Sniffs.SubDir.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\CategoryA\\SubDir\\IncorrectLevelShouldStillBeFoundSniff',
6464
'MyStandard.CategoryB.FindMe' => 'MyStandard\\Sniffs\\CategoryB\\FindMeSniff',
65-
'.Sniffs.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\IncorrectLevelShouldStillBeFoundSniff',
65+
'Sniffs.SubDir.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\CategoryA\\SubDir\\IncorrectLevelShouldStillBeFoundSniff',
6666
];
6767

68-
$this->assertSame($expectedSniffCodes, $ruleset->sniffCodes, 'Registered sniffs do not match expectation');
68+
// Sort the value to make the tests stable as different OSes will read directories
69+
// in a different order and the order is not relevant for these tests. Just the values.
70+
$actual = $ruleset->sniffCodes;
71+
ksort($actual);
72+
73+
$this->assertSame($expectedSniffCodes, $actual, 'Registered sniffs do not match expectation');
6974

7075
}//end testExpandSniffDirectory()
7176

0 commit comments

Comments
 (0)