Skip to content

Commit

Permalink
Variables/RestrictedVariables: fix the test
Browse files Browse the repository at this point in the history
Now the test is actually running under the proper namespace, it comes to light that the test for the `exclude` property is not working as it is using an outdated syntax.

Fixed now.
  • Loading branch information
jrfnl committed Jul 27, 2020
1 parent 3e03066 commit bc780bb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ $phrase = <<<EOD
Your user-agent is {$_SERVER['HTTP_USER_AGENT']}
EOD;

// phpcs:set WordPressVIPMinimum.Variables.RestrictedVariables exclude user_meta
$query = "SELECT * FROM $wpdb->usermeta"; // Error.
// phpcs:set WordPressVIPMinimum.Variables.RestrictedVariables exclude[] user_meta
$query = "SELECT * FROM $wpdb->usermeta"; // Ok, excluded.

// phpcs:set WordPressVIPMinimum.Functions.RestrictedFunctions exclude false
// phpcs:set WordPressVIPMinimum.Functions.RestrictedFunctions exclude[]

foo( $_SESSION ); // Error.
foo( $_SESSION['bar'] ); // Error.

0 comments on commit bc780bb

Please sign in to comment.