This repository has been archived by the owner on Jul 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Add checks for batcache variant #282
Open
devonliu
wants to merge
6
commits into
Automattic:master
Choose a base branch
from
devonliu:issue153_batcache_variant_check
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add checks for batcache variant #282
devonliu
wants to merge
6
commits into
Automattic:master
from
devonliu:issue153_batcache_variant_check
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add checks per issue Automattic#153: > A variant that includes one of include|require|echo|print|dump|export|open|sock|unlink||evalor does *not* include a reference to a superglobal (regex check for$_`) will fail and we should flag those early. Test cases also added
@@ -0,0 +1,12 @@ | |||
<?php | |||
|
|||
die(); //Don't actually run the following code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can safely omit the die()...this only gets read in as text, not included/required as PHP so it won't be executed.
Improve error descriptions on batcache variant error: - indicate the illegal word that causes the warning - mention superglobal that is missing
- delete "die()" as this file is not likely to be included/required as php for execution - add a no-error positive test case
- Assert only on the slug part from the error, so description can be flexible - Separate test files into two to allow for two separate testings - Remove "assertFalse" from CodeCheckTestBase.php to allow for testing of positive test cases
While updating the testing part I noticed a few oddities:
As it currently stands almost all test classes for vip-scanner come in one of 2 kinds: the ones that extend |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add checks per issue #153:
Test case also added