Commit 9aeec04
committed
Tests: fix testStdIn() methods to work with PHPCS 4.x
PHPCS 4.x removed special test-specific code from the Ruleset class that handled `Config::$sniffs` restrictions differently when `PHP_CODESNIFFER_IN_TESTS` was defined (see PHPCSStandards/PHP_CodeSniffer/ 996).
This caused `testStdIn()` tests that used `$config->standards = array('WordPress')` to attempt loading the entire WordPress standard with all dependencies, resulting in errors about missing standards.
The fix uses minimal ruleset XML files that only include the specific sniff being tested making the test pass with both PHPCS 3.x and 4.x.1 parent d41b6eb commit 9aeec04
File tree
4 files changed
+16
-4
lines changed- WordPress/Tests
- Files
- Utils
4 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
219 | 218 | | |
220 | 219 | | |
221 | 220 | | |
| |||
0 commit comments