@@ -501,15 +501,15 @@ public function dataNestedSuppressLine()
501
501
502
502
// Process with line suppression nested within disable/enable suppression.
503
503
'disable/enable: slash comment, next line nested single line suppression ' => [
504
- 'before ' => '// phpcs:disable ' .PHP_EOL .'// phpcs:ignore ' ,
504
+ 'before ' => '// phpcs:disable ' ."\n" .'// phpcs:ignore ' ,
505
505
'after ' => '// phpcs:enable ' ,
506
506
],
507
507
'disable/enable: slash comment, with @, next line nested single line suppression ' => [
508
- 'before ' => '// @phpcs:disable ' .PHP_EOL .'// @phpcs:ignore ' ,
508
+ 'before ' => '// @phpcs:disable ' ."\n" .'// @phpcs:ignore ' ,
509
509
'after ' => '// @phpcs:enable ' ,
510
510
],
511
511
'disable/enable: hash comment, next line nested single line suppression ' => [
512
- 'before ' => '# @phpcs:disable ' .PHP_EOL .'# @phpcs:ignore ' ,
512
+ 'before ' => '# @phpcs:disable ' ."\n" .'# @phpcs:ignore ' ,
513
513
'after ' => '# @phpcs:enable ' ,
514
514
],
515
515
];
@@ -671,7 +671,7 @@ public function dataSuppressFile()
671
671
'ignoreFile: start of file, hash comment, with @ ' => ['before ' => '# @phpcs:ignoreFile ' ],
672
672
'ignoreFile: start of file, single-line star comment ' => ['before ' => '/* phpcs:ignoreFile */ ' ],
673
673
'ignoreFile: start of file, multi-line star comment ' => [
674
- 'before ' => '/* ' .PHP_EOL .' phpcs:ignoreFile ' .PHP_EOL .' */ ' ,
674
+ 'before ' => '/* ' ."\n" .' phpcs:ignoreFile ' ."\n" .' */ ' ,
675
675
],
676
676
'ignoreFile: start of file, single-line docblock comment ' => ['before ' => '/** phpcs:ignoreFile */ ' ],
677
677
@@ -752,18 +752,18 @@ public function dataDisableSelected()
752
752
'expectedErrors ' => 1 ,
753
753
],
754
754
'disable: single sniff, docblock ' => [
755
- 'before ' => '/** ' .PHP_EOL .' * phpcs:disable Generic.Commenting.Todo ' .PHP_EOL .' */ ' ,
755
+ 'before ' => '/** ' ."\n" .' * phpcs:disable Generic.Commenting.Todo ' ."\n" .' */ ' ,
756
756
'expectedErrors ' => 1 ,
757
757
],
758
758
'disable: single sniff, docblock, with @ ' => [
759
- 'before ' => '/** ' .PHP_EOL .' * @phpcs:disable Generic.Commenting.Todo ' .PHP_EOL .' */ ' ,
759
+ 'before ' => '/** ' ."\n" .' * @phpcs:disable Generic.Commenting.Todo ' ."\n" .' */ ' ,
760
760
'expectedErrors ' => 1 ,
761
761
],
762
762
763
763
// Multiple sniffs.
764
764
'disable: multiple sniffs in one comment ' => ['before ' => '// phpcs:disable Generic.Commenting.Todo,Generic.PHP.LowerCaseConstant ' ],
765
765
'disable: multiple sniff in multiple comments ' => [
766
- 'before ' => '// phpcs:disable Generic.Commenting.Todo ' .PHP_EOL .'// phpcs:disable Generic.PHP.LowerCaseConstant ' ,
766
+ 'before ' => '// phpcs:disable Generic.Commenting.Todo ' ."\n" .'// phpcs:disable Generic.PHP.LowerCaseConstant ' ,
767
767
],
768
768
769
769
// Selectiveness variations.
@@ -780,17 +780,17 @@ public function dataDisableSelected()
780
780
781
781
// Wrong category/sniff/code.
782
782
'disable: wrong error code and category ' => [
783
- 'before ' => '/** ' .PHP_EOL .' * phpcs:disable Generic.PHP.LowerCaseConstant.Upper,Generic.Comments ' .PHP_EOL .' */ ' ,
783
+ 'before ' => '/** ' ."\n" .' * phpcs:disable Generic.PHP.LowerCaseConstant.Upper,Generic.Comments ' ."\n" .' */ ' ,
784
784
'expectedErrors ' => 1 ,
785
785
'expectedWarnings ' => 1 ,
786
786
],
787
787
'disable: wrong category, docblock ' => [
788
- 'before ' => '/** ' .PHP_EOL .' * phpcs:disable Generic.Files ' .PHP_EOL .' */ ' ,
788
+ 'before ' => '/** ' ."\n" .' * phpcs:disable Generic.Files ' ."\n" .' */ ' ,
789
789
'expectedErrors ' => 1 ,
790
790
'expectedWarnings ' => 1 ,
791
791
],
792
792
'disable: wrong category, docblock, with @ ' => [
793
- 'before ' => '/** ' .PHP_EOL .' * @phpcs:disable Generic.Files ' .PHP_EOL .' */ ' ,
793
+ 'before ' => '/** ' ."\n" .' * @phpcs:disable Generic.Files ' ."\n" .' */ ' ,
794
794
'expectedErrors ' => 1 ,
795
795
'expectedWarnings ' => 1 ,
796
796
],
@@ -1047,7 +1047,7 @@ public function dataIgnoreSelected()
1047
1047
'expectedWarnings ' => 1 ,
1048
1048
],
1049
1049
'disable: single sniff; ignore: single sniff ' => [
1050
- 'before ' => '// phpcs:disable Generic.Commenting.Todo ' .PHP_EOL .'// phpcs:ignore Generic.PHP.LowerCaseConstant ' ,
1050
+ 'before ' => '// phpcs:disable Generic.Commenting.Todo ' ."\n" .'// phpcs:ignore Generic.PHP.LowerCaseConstant ' ,
1051
1051
'expectedErrors ' => 1 ,
1052
1052
'expectedWarnings ' => 0 ,
1053
1053
],
0 commit comments