Skip to content

Commit 248a2ac

Browse files
committed
PHP/DevelopmentFunctions: add tests for namespaced names
1 parent b95ef97 commit 248a2ac

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

WordPress/Tests/PHP/DevelopmentFunctionsUnitTest.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,11 @@ phpinfo(); // Error.
3535

3636
Wrapper_Class::var_dump(); // OK, not the native PHP function.
3737
$wrapper ->var_dump(); // OK, not the native PHP function.
38-
namespace\var_dump(); // OK as long as the file is namespaced.
39-
MyNamespace\var_dump(); // OK, namespaced function.
38+
39+
/*
40+
* Safeguard correct handling of all types of namespaced function calls.
41+
*/
42+
\var_dump( $value );
43+
MyNamespace\var_dump( $value );
44+
\MyNamespace\var_dump( $value );
45+
namespace\var_dump( $value ); // The sniff should start flagging this once it can resolve relative namespaces.

WordPress/Tests/PHP/DevelopmentFunctionsUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function getWarningList() {
5252
24 => 1,
5353
33 => 1,
5454
34 => 1,
55+
42 => 1,
5556
);
5657
}
5758
}

0 commit comments

Comments
 (0)