Skip to content

Commit f66c323

Browse files
committed
Tests/ErrorSuppressionTest: normalize data provider arrays
... to improve scannability of the test cases covered. See 225
1 parent 8ffe403 commit f66c323

File tree

1 file changed

+60
-20
lines changed

1 file changed

+60
-20
lines changed

tests/Core/ErrorSuppressionTest.php

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,24 @@ public static function dataSuppressLine()
391391
],
392392

393393
// With suppression on line before.
394-
'ignore: line before, slash comment' => ['before' => '// phpcs:ignore'],
395-
'ignore: line before, slash comment, with @' => ['before' => '// @phpcs:ignore'],
396-
'ignore: line before, hash comment' => ['before' => '# phpcs:ignore'],
397-
'ignore: line before, hash comment, with @' => ['before' => '# @phpcs:ignore'],
398-
'ignore: line before, star comment' => ['before' => '/* phpcs:ignore */'],
399-
'ignore: line before, star comment, with @' => ['before' => '/* @phpcs:ignore */'],
394+
'ignore: line before, slash comment' => [
395+
'before' => '// phpcs:ignore',
396+
],
397+
'ignore: line before, slash comment, with @' => [
398+
'before' => '// @phpcs:ignore',
399+
],
400+
'ignore: line before, hash comment' => [
401+
'before' => '# phpcs:ignore',
402+
],
403+
'ignore: line before, hash comment, with @' => [
404+
'before' => '# @phpcs:ignore',
405+
],
406+
'ignore: line before, star comment' => [
407+
'before' => '/* phpcs:ignore */',
408+
],
409+
'ignore: line before, star comment, with @' => [
410+
'before' => '/* @phpcs:ignore */',
411+
],
400412

401413
// With suppression as trailing comment on code line.
402414
'ignore: end of line, slash comment' => [
@@ -417,7 +429,9 @@ public static function dataSuppressLine()
417429
],
418430

419431
// Deprecated syntax.
420-
'old style: line before, slash comment' => ['before' => '// @codingStandardsIgnoreLine'],
432+
'old style: line before, slash comment' => [
433+
'before' => '// @codingStandardsIgnoreLine',
434+
],
421435
'old style: end of line, slash comment' => [
422436
'before' => '',
423437
'after' => ' // @codingStandardsIgnoreLine',
@@ -732,16 +746,30 @@ public static function dataSuppressFile()
732746
],
733747

734748
// Process with suppression.
735-
'ignoreFile: start of file, slash comment' => ['before' => '// phpcs:ignoreFile'],
736-
'ignoreFile: start of file, slash comment, with @' => ['before' => '// @phpcs:ignoreFile'],
737-
'ignoreFile: start of file, slash comment, mixed case' => ['before' => '// PHPCS:Ignorefile'],
738-
'ignoreFile: start of file, hash comment' => ['before' => '# phpcs:ignoreFile'],
739-
'ignoreFile: start of file, hash comment, with @' => ['before' => '# @phpcs:ignoreFile'],
740-
'ignoreFile: start of file, single-line star comment' => ['before' => '/* phpcs:ignoreFile */'],
749+
'ignoreFile: start of file, slash comment' => [
750+
'before' => '// phpcs:ignoreFile',
751+
],
752+
'ignoreFile: start of file, slash comment, with @' => [
753+
'before' => '// @phpcs:ignoreFile',
754+
],
755+
'ignoreFile: start of file, slash comment, mixed case' => [
756+
'before' => '// PHPCS:Ignorefile',
757+
],
758+
'ignoreFile: start of file, hash comment' => [
759+
'before' => '# phpcs:ignoreFile',
760+
],
761+
'ignoreFile: start of file, hash comment, with @' => [
762+
'before' => '# @phpcs:ignoreFile',
763+
],
764+
'ignoreFile: start of file, single-line star comment' => [
765+
'before' => '/* phpcs:ignoreFile */',
766+
],
741767
'ignoreFile: start of file, multi-line star comment' => [
742768
'before' => '/*'.PHP_EOL.' phpcs:ignoreFile'.PHP_EOL.' */',
743769
],
744-
'ignoreFile: start of file, single-line docblock comment' => ['before' => '/** phpcs:ignoreFile */'],
770+
'ignoreFile: start of file, single-line docblock comment' => [
771+
'before' => '/** phpcs:ignoreFile */',
772+
],
745773

746774
// Process late comment.
747775
'ignoreFile: late comment, slash comment' => [
@@ -750,12 +778,18 @@ public static function dataSuppressFile()
750778
],
751779

752780
// Deprecated syntax.
753-
'old style: start of file, slash comment' => ['before' => '// @codingStandardsIgnoreFile'],
754-
'old style: start of file, single-line star comment' => ['before' => '/* @codingStandardsIgnoreFile */'],
781+
'old style: start of file, slash comment' => [
782+
'before' => '// @codingStandardsIgnoreFile',
783+
],
784+
'old style: start of file, single-line star comment' => [
785+
'before' => '/* @codingStandardsIgnoreFile */',
786+
],
755787
'old style: start of file, multi-line star comment' => [
756788
'before' => '/*'.PHP_EOL.' @codingStandardsIgnoreFile'.PHP_EOL.' */',
757789
],
758-
'old style: start of file, single-line docblock comment' => ['before' => '/** @codingStandardsIgnoreFile */'],
790+
'old style: start of file, single-line docblock comment' => [
791+
'before' => '/** @codingStandardsIgnoreFile */',
792+
],
759793

760794
// Deprecated syntax, late comment.
761795
'old style: late comment, slash comment' => [
@@ -843,7 +877,9 @@ public static function dataDisableSelected()
843877
],
844878

845879
// Multiple sniffs.
846-
'disable: multiple sniffs in one comment' => ['before' => '// phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant'],
880+
'disable: multiple sniffs in one comment' => [
881+
'before' => '// phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant',
882+
],
847883
'disable: multiple sniff in multiple comments' => [
848884
'before' => '// phpcs:disable Generic.Commenting.Todo'.PHP_EOL.'// phpcs:disable Generic.PHP.LowerCaseConstant',
849885
],
@@ -853,12 +889,16 @@ public static function dataDisableSelected()
853889
'before' => '// phpcs:disable Generic.Commenting',
854890
'expectedErrors' => 1,
855891
],
856-
'disable: whole standard' => ['before' => '// phpcs:disable Generic'],
892+
'disable: whole standard' => [
893+
'before' => '// phpcs:disable Generic',
894+
],
857895
'disable: single errorcode' => [
858896
'before' => '# @phpcs:disable Generic.Commenting.Todo.TaskFound',
859897
'expectedErrors' => 1,
860898
],
861-
'disable: single errorcode and a category' => ['before' => '// phpcs:disable Generic.PHP.LowerCaseConstant.Found,Generic.Commenting'],
899+
'disable: single errorcode and a category' => [
900+
'before' => '// phpcs:disable Generic.PHP.LowerCaseConstant.Found,Generic.Commenting',
901+
],
862902

863903
// Wrong category/sniff/code.
864904
'disable: wrong error code and category' => [

0 commit comments

Comments
 (0)