Skip to content

Commit 334b395

Browse files
authored
Merge pull request #585 from Automattic/fix/unit-test-failure
Hooks/AlwaysReturnInFilter: adjust expectations for a test
2 parents 261cb4a + 09f3700 commit 334b395

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

WordPressVIPMinimum/Tests/Hooks/AlwaysReturnInFilterUnitTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class tokenizer_bug_test {
185185
add_filter( 'tokenizer_bug', [ $this, 'tokenizer_bug' ] );
186186
}
187187

188-
public function tokenizer_bug( $param ): namespace\Foo {} // Ok (tokenizer bug in PHPCS < 3.5.7/3.6.0).
188+
public function tokenizer_bug( $param ): namespace\Foo {} // Ok (tokenizer bug PHPCS < 3.5.7) / Error in PHPCS >= 3.5.7.
189189
}
190190

191191
// Intentional parse error. This has to be the last test in the file!

WordPressVIPMinimum/Tests/Hooks/AlwaysReturnInFilterUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
namespace WordPressVIPMinimum\Tests\Hooks;
99

10+
use PHP_CodeSniffer\Config;
1011
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
12+
1113
/**
1214
* Unit test class for the Hooks/AlwaysReturn sniff.
1315
*
@@ -31,6 +33,7 @@ public function getErrorList() {
3133
105 => 1,
3234
129 => 1,
3335
163 => 1,
36+
188 => version_compare( Config::VERSION, '3.5.7', '>=' ) ? 1 : 0,
3437
];
3538
}
3639

0 commit comments

Comments
 (0)