Skip to content

Commit

Permalink
Fix generator name used in testDeprecatedSniffsListDoesNotShowNeedsCs…
Browse files Browse the repository at this point in the history
…Mode()

This test is about ensuring that deprecated sniffs messages are not
displayed when viewing sniff documentation, and it was added in 2507c78
(see #281).
Before, passing any value to the `generator` parameter was enough and
so, probably due to a typo, `text` was passed which does not correspond
to a valid generator.

The code being tested only checks if `Config::generator` is not `null`:

https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/2507c78d6aa8fe714b19d5e62519cd75f0a3aceb/src/Ruleset.php#L343

Now that `Config` throws an exception when an invalid generator is
passed. The test had to be adjusted to use a valid generator name.
  • Loading branch information
rodrigoprimo committed Dec 13, 2024
1 parent 3b6c8c6 commit 7141e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Core/Ruleset/ShowSniffDeprecationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public static function dataDeprecatedSniffsListDoesNotShowNeedsCsMode()
return [
'Standard using deprecated sniffs; documentation is requested' => [
'standard' => __DIR__.'/ShowSniffDeprecationsTest.xml',
'additionalArgs' => ['--generator=text'],
'additionalArgs' => ['--generator=Text'],
],
];

Expand Down

0 comments on commit 7141e6d

Please sign in to comment.