From 8c08a1de329bff95d10e2999b449ad483e497a36 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 16 Nov 2024 23:29:14 +0100 Subject: [PATCH] Tests/Ruleset/XML fixtures: add direct link between fixture and test using the fixture Small tweak to make sure the XML rulesets used for specific tests are directly linked to those tests via the XML ruleset name - this should make the tests more self-documenting. --- tests/Core/Ruleset/ExplainTest.php | 2 +- tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml | 2 +- .../Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml | 2 +- tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml | 2 +- ...pertyAppliesPropertyToMultipleSniffsInCategoryTest.xml | 2 +- ...tThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml | 2 +- ...tThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml | 2 +- .../Ruleset/SetPropertyNotAllowedViaAttributeTest.xml | 2 +- .../SetPropertyThrowsErrorOnInvalidPropertyTest.xml | 2 +- .../ShowSniffDeprecationsEmptyDeprecationVersionTest.xml | 2 +- .../ShowSniffDeprecationsEmptyRemovalVersionTest.xml | 2 +- ...ShowSniffDeprecationsInvalidDeprecationMessageTest.xml | 2 +- ...ShowSniffDeprecationsInvalidDeprecationVersionTest.xml | 2 +- .../ShowSniffDeprecationsInvalidRemovalVersionTest.xml | 2 +- tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml | 2 +- .../Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml | 2 +- tests/Core/Ruleset/ShowSniffDeprecationsTest.php | 8 ++++---- tests/Core/Ruleset/ShowSniffDeprecationsTest.xml | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/Core/Ruleset/ExplainTest.php b/tests/Core/Ruleset/ExplainTest.php index 5438c65cfc..0d899608df 100644 --- a/tests/Core/Ruleset/ExplainTest.php +++ b/tests/Core/Ruleset/ExplainTest.php @@ -185,7 +185,7 @@ public function testExplainWithDeprecatedSniffs() $ruleset = new Ruleset($config); $expected = PHP_EOL; - $expected .= 'The SniffDeprecationTest standard contains 9 sniffs'.PHP_EOL.PHP_EOL; + $expected .= 'The ShowSniffDeprecationsTest standard contains 9 sniffs'.PHP_EOL.PHP_EOL; $expected .= 'Fixtures (9 sniffs)'.PHP_EOL; $expected .= '-------------------'.PHP_EOL; diff --git a/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml b/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml index 5840d0c362..89005ad2d1 100644 --- a/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml +++ b/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml b/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml index 7ff2178247..deb6944d08 100644 --- a/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml +++ b/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml b/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml index 387f419e8d..475ba5cff3 100644 --- a/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml +++ b/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml b/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml index 7c4ca4fd35..67fcca351d 100644 --- a/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml +++ b/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml b/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml index 979b48f522..a678c91555 100644 --- a/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml +++ b/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml b/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml index 48a36a8313..8ce97e2dd3 100644 --- a/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml +++ b/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml b/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml index 7caae3d393..da5423913c 100644 --- a/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml +++ b/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml b/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml index 5dca1a010d..a1742618a2 100644 --- a/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml +++ b/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml index 5e2480bf2f..f10654fc40 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml index 6e667375af..0298571804 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml index d325167994..295d7b998a 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml index 89d83ab528..c7accdf29f 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml index c1eb062e1c..c5abf66da8 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml index 3ce96ce89f..6e3f6be53e 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml index 9f1cc85155..8a7870a585 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsTest.php b/tests/Core/Ruleset/ShowSniffDeprecationsTest.php index 43f850f051..bef388bcbc 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsTest.php +++ b/tests/Core/Ruleset/ShowSniffDeprecationsTest.php @@ -234,7 +234,7 @@ public function testDeprecatedSniffsWarning() $config = new ConfigDouble(["--standard=$standard", '--no-colors']); $ruleset = new Ruleset($config); - $expected = 'WARNING: The SniffDeprecationTest standard uses 5 deprecated sniffs'.PHP_EOL; + $expected = 'WARNING: The ShowSniffDeprecationsTest standard uses 5 deprecated sniffs'.PHP_EOL; $expected .= '--------------------------------------------------------------------------------'.PHP_EOL; $expected .= '- Fixtures.Deprecated.WithLongReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; @@ -321,13 +321,13 @@ public function testReportWidthIsRespected($reportWidth, $expectedOutput) */ public static function dataReportWidthIsRespected() { - $summaryLine = 'WARNING: The SniffDeprecationTest standard uses 1 deprecated sniff'.PHP_EOL; + $summaryLine = 'WARNING: The ShowSniffDeprecationsTest standard uses 1 deprecated sniff'.PHP_EOL; // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important. return [ 'Report width small: 40; with truncated sniff name and wrapped header and footer lines' => [ 'reportWidth' => 40, - 'expectedOutput' => 'WARNING: The SniffDeprecationTest'.PHP_EOL + 'expectedOutput' => 'WARNING: The ShowSniffDeprecationsTest'.PHP_EOL .'standard uses 1 deprecated sniff'.PHP_EOL .'----------------------------------------'.PHP_EOL .'- Fixtures.Deprecated.WithLongRepla...'.PHP_EOL @@ -409,7 +409,7 @@ public function testDeprecatedSniffsAreListedAlphabetically() $config = new ConfigDouble(["--standard=$standard", '--no-colors']); $ruleset = new Ruleset($config); - $expected = 'WARNING: The SniffDeprecationTest standard uses 2 deprecated sniffs'.PHP_EOL; + $expected = 'WARNING: The ShowSniffDeprecationsTest standard uses 2 deprecated sniffs'.PHP_EOL; $expected .= '--------------------------------------------------------------------------------'.PHP_EOL; $expected .= '- Fixtures.Deprecated.WithoutReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.4.0 and will be removed in v4.0.0.'.PHP_EOL; diff --git a/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml b/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml index 4c1dec2203..4665f439b5 100644 --- a/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml +++ b/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml @@ -1,5 +1,5 @@ - +