From 7141e6d5f00e8101f57a88ad142594b6548de2c2 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Dec 2024 09:16:14 -0300 Subject: [PATCH] Fix generator name used in testDeprecatedSniffsListDoesNotShowNeedsCsMode() This test is about ensuring that deprecated sniffs messages are not displayed when viewing sniff documentation, and it was added in 2507c78 (see https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/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. --- tests/Core/Ruleset/ShowSniffDeprecationsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsTest.php b/tests/Core/Ruleset/ShowSniffDeprecationsTest.php index 6979d69a7b..16aba7d2ac 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsTest.php +++ b/tests/Core/Ruleset/ShowSniffDeprecationsTest.php @@ -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'], ], ];