File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1010namespace WordPressCS \WordPress \Tests \Security ;
1111
1212use PHP_CodeSniffer \Tests \Standards \AbstractSniffTestCase ;
13+ use PHPCSUtils \BackCompat \Helper ;
1314
1415/**
1516 * Unit test class for the ValidatedSanitizedInput sniff.
@@ -35,6 +36,9 @@ final class ValidatedSanitizedInputUnitTest extends AbstractSniffTestCase {
3536 * @return array<int, int> Key is the line number, value is the number of expected errors.
3637 */
3738 public function getErrorList ( $ testFile = '' ) {
39+ $ phpcs_version = Helper::getVersion ();
40+ $ is_phpcs_4 = version_compare ( $ phpcs_version , '3.99.99 ' , '> ' );
41+
3842 switch ( $ testFile ) {
3943 case 'ValidatedSanitizedInputUnitTest.1.inc ' :
4044 return array (
@@ -122,9 +126,9 @@ public function getErrorList( $testFile = '' ) {
122126 532 => 2 ,
123127 533 => 2 ,
124128 534 => 2 ,
125- 549 => 1 ,
126- 552 => 1 ,
127- 555 => 1 ,
129+ 549 => ( true === $ is_phpcs_4 ) ? 2 : 1 ,
130+ 552 => ( true === $ is_phpcs_4 ) ? 2 : 1 ,
131+ 555 => ( true === $ is_phpcs_4 ) ? 2 : 1 ,
128132 567 => 1 ,
129133 570 => 1 ,
130134 573 => 1 ,
You can’t perform that action at this time.
0 commit comments