Skip to content

Commit

Permalink
Merge pull request #559 from Automattic/fix/restrictedvariables-tests…
Browse files Browse the repository at this point in the history
…-incorrect-namespace
  • Loading branch information
GaryJones authored Jul 27, 2020
2 parents f5bde12 + bc780bb commit 4d644cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package VIPCS\WordPressVIPMinimum
*/

namespace WordPress\Tests\Variables;
namespace WordPressVIPMinimum\Tests\Variables;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;

Expand Down

0 comments on commit 4d644cb

Please sign in to comment.