Skip to content

Commit 0671858

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

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

WordPress/Tests/PHP/DiscouragedPHPFunctionsUnitTest.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
4-
5-
6-
7-
3+
// Safeguard against false positives on namespaced function calls.
4+
MyNamespace\serialize( $value );
5+
\MyNamespace\serialize( $value );
6+
namespace\serialize( $value ); // The sniff should start flagging this once it can resolve relative namespaces.
87

98
serialize(); // Warning.
9+
\serialize( $value ); // Warning.
1010
unserialize(); // Warning.
1111

1212
urlencode(); // Warning.

WordPress/Tests/PHP/DiscouragedPHPFunctionsUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function getErrorList() {
3737
*/
3838
public function getWarningList() {
3939
return array(
40+
8 => 1,
4041
9 => 1,
4142
10 => 1,
4243
12 => 1,

0 commit comments

Comments
 (0)