Skip to content

Commit 888479a

Browse files
committed
ErrorSuppressionTest::testDisableSelected(): add some more tests
By the looks of it, combining disabling at different levels and disabling error codes wasn't covered in the tests.
1 parent b1e74cc commit 888479a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/Core/ErrorSuppressionTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,18 @@ public function dataDisableSelected()
849849
'expectedErrors' => 1,
850850
],
851851
'disable: whole standard' => ['before' => '// phpcs:disable Generic'],
852+
'disable: single errorcode' => [
853+
'before' => '# @phpcs:disable Generic.Commenting.Todo.TaskFound',
854+
'expectedErrors' => 1,
855+
],
856+
'disable: single errorcode and a category' => ['before' => '// phpcs:disable Generic.PHP.LowerCaseConstant.Found,Generic.Commenting'],
852857

853-
// Wrong category using docblocks.
858+
// Wrong category/sniff/code.
859+
'disable: wrong error code and category' => [
860+
'before' => '/**'.PHP_EOL.' * phpcs:disable Generic.PHP.LowerCaseConstant.Upper,Generic.Comments'.PHP_EOL.' */ ',
861+
'expectedErrors' => 1,
862+
'expectedWarnings' => 1,
863+
],
854864
'disable: wrong category, docblock' => [
855865
'before' => '/**'.PHP_EOL.' * phpcs:disable Generic.Files'.PHP_EOL.' */ ',
856866
'expectedErrors' => 1,

0 commit comments

Comments
 (0)