Skip to content

Commit

Permalink
GetSniffCodeTest: improve tests
Browse files Browse the repository at this point in the history
Add some additional tests for sniffs not complying with the naming conventions.
  • Loading branch information
jrfnl committed Feb 7, 2025
1 parent 5e5e6dc commit da1768e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/Core/Util/Common/GetSniffCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit da1768e

Please sign in to comment.