Ruleset Tests: revert 485 and fix it #509
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #485, three tests were commented out because they seemed to break the ruleset tests.
At the request of Gary, I've had a look see to try and find the underlying cause.
Turned out to be a combination of three things:
EscapeOutput
not having enough defensive coding for when a faulty function call without parameters would be encountered.Obviously we can't do anything about 1.
As for 3, I've opened a PR in WPCS upstream to fix this, but that fix won't be available to VIP until WPCS 3.0.0 has been released and VIPCS upgrades.
See: WordPress/WordPress-Coding-Standards#1939
So, in the mean time, let's make sure the function calls in the test case file which aren't intended to trigger the
EscapeOutput
sniff, don't trigger it.And that's what's done in this PR.
To reproduce my findings / How to investigate this in the future:
phpcs -ps --severity=1 --standard=WordPressVIPMinimum ./WordPressVIPMinimum/ruleset-test.inc