From da1768ec6bda959b5b1d12a61f604d1e5e881b6d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 6 Feb 2025 21:56:53 +0100 Subject: [PATCH] GetSniffCodeTest: improve tests Add some additional tests for sniffs not complying with the naming conventions. --- tests/Core/Util/Common/GetSniffCodeTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/Core/Util/Common/GetSniffCodeTest.php b/tests/Core/Util/Common/GetSniffCodeTest.php index 48161f1ce2..79bc611e99 100644 --- a/tests/Core/Util/Common/GetSniffCodeTest.php +++ b/tests/Core/Util/Common/GetSniffCodeTest.php @@ -153,7 +153,7 @@ public static function dataGetSniffCode() 'expected' => 'MyStandard.PHP.MyName', ], 'Test in external standard without namespace prefix' => [ - 'fqnClass' => 'MyStandard\\Tests\\PHP\\MyNameSniff', + 'fqnClass' => 'MyStandard\\Tests\\PHP\\MyNameUnitTest', 'expected' => 'MyStandard.PHP.MyName', ], 'Sniff in external standard with namespace prefix' => [ @@ -192,6 +192,18 @@ public static function dataGetSniffCode() 'fqnClass' => 'CompanyName\\CustomSniffs\\Whatever\\CheckMeSniff', 'expected' => 'CompanyName.Whatever.CheckMe', ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [5]' => [ + 'fqnClass' => 'CompanyName\\Sniffs\\Category\\Sniff', + 'expected' => 'CompanyName.Category.', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [6]' => [ + 'fqnClass' => 'CompanyName\\Tests\\Category\\UnitTest', + 'expected' => 'CompanyName.Category.', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [7]' => [ + 'fqnClass' => 'Sniffs\\Category\\NamedSniff', + 'expected' => '.Category.Named', + ], ]; }//end dataGetSniffCode()