Skip to content

Commit

Permalink
Merge pull request #696 from PHPCSStandards/feature/ruleset-showsniff…
Browse files Browse the repository at this point in the history
…deprecationstest-bug-fix

ShowSniffDeprecationsTest: fix bug in tests
  • Loading branch information
jrfnl authored Nov 18, 2024
2 parents 5e1e3a6 + a52c354 commit 15db723
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Core/Ruleset/ShowSniffDeprecationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenSelectedSniffsAreNotDepre
];
foreach ($sniffs as $sniffCode) {
$parts = explode('.', strtolower($sniffCode));
$sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff';
$sniffName = $parts[0].'\\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff';
$restrictions[strtolower($sniffName)] = true;
}

Expand All @@ -158,7 +158,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenSelectedSniffsAreNotDepre
$sniffFiles[] = $sniffFile;
}

$ruleset->registerSniffs($allSniffs, $restrictions, []);
$ruleset->registerSniffs($sniffFiles, $restrictions, []);
$ruleset->populateTokenListeners();

$this->expectOutputString('');
Expand Down Expand Up @@ -195,7 +195,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenAllDeprecatedSniffsAreExc
];
foreach ($exclude as $sniffCode) {
$parts = explode('.', strtolower($sniffCode));
$sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff';
$sniffName = $parts[0].'\\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff';
$exclusions[strtolower($sniffName)] = true;
}

Expand All @@ -207,7 +207,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenAllDeprecatedSniffsAreExc
$sniffFiles[] = $sniffFile;
}

$ruleset->registerSniffs($allSniffs, [], $exclusions);
$ruleset->registerSniffs($sniffFiles, [], $exclusions);
$ruleset->populateTokenListeners();

$this->expectOutputString('');
Expand Down

0 comments on commit 15db723

Please sign in to comment.