Skip to content

Commit bc780bb

Browse files
committed
Variables/RestrictedVariables: fix the test
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.
1 parent 3e03066 commit bc780bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WordPressVIPMinimum/Tests/Variables/RestrictedVariablesUnitTest.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ $phrase = <<<EOD
2828
Your user-agent is {$_SERVER['HTTP_USER_AGENT']}
2929
EOD;
3030

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

34-
// phpcs:set WordPressVIPMinimum.Functions.RestrictedFunctions exclude false
34+
// phpcs:set WordPressVIPMinimum.Functions.RestrictedFunctions exclude[]
3535

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

0 commit comments

Comments
 (0)