Skip to content

Commit d694aea

Browse files
authored
Merge pull request #805 from PHPCSStandards/feature/getsniffcodetest-add-more-tests
GetSniffCodeTest: improve tests
2 parents 98c1ce8 + da1768e commit d694aea

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/Core/Util/Common/GetSniffCodeTest.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public static function dataGetSniffCode()
153153
'expected' => 'MyStandard.PHP.MyName',
154154
],
155155
'Test in external standard without namespace prefix' => [
156-
'fqnClass' => 'MyStandard\\Tests\\PHP\\MyNameSniff',
156+
'fqnClass' => 'MyStandard\\Tests\\PHP\\MyNameUnitTest',
157157
'expected' => 'MyStandard.PHP.MyName',
158158
],
159159
'Sniff in external standard with namespace prefix' => [
@@ -192,6 +192,18 @@ public static function dataGetSniffCode()
192192
'fqnClass' => 'CompanyName\\CustomSniffs\\Whatever\\CheckMeSniff',
193193
'expected' => 'CompanyName.Whatever.CheckMe',
194194
],
195+
'Sniff provided via file include and doesn\'t comply with naming conventions [5]' => [
196+
'fqnClass' => 'CompanyName\\Sniffs\\Category\\Sniff',
197+
'expected' => 'CompanyName.Category.',
198+
],
199+
'Sniff provided via file include and doesn\'t comply with naming conventions [6]' => [
200+
'fqnClass' => 'CompanyName\\Tests\\Category\\UnitTest',
201+
'expected' => 'CompanyName.Category.',
202+
],
203+
'Sniff provided via file include and doesn\'t comply with naming conventions [7]' => [
204+
'fqnClass' => 'Sniffs\\Category\\NamedSniff',
205+
'expected' => '.Category.Named',
206+
],
195207
];
196208

197209
}//end dataGetSniffCode()

0 commit comments

Comments
 (0)