Skip to content

Commit c2fa766

Browse files
committed
PR 2617 WP/AlternativeFunctions: add tests for namespaced names
1 parent c059096 commit c2fa766

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

WordPress/Tests/WP/AlternativeFunctionsUnitTest.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,11 @@ file_get_contents(
147147
// Not using plugin_dir_path() for reasons.
148148
$url
149149
); // Warning.
150+
151+
/*
152+
* Safeguard support for PHP 8.0+ tokenization of namespaced "names".
153+
*/
154+
\curl_init();
155+
MyNamespace\curl_init();
156+
\MyNamespace\curl_init();
157+
namespace\curl_init(); // The sniff should start flagging this once it can resolve relative namespaces.

WordPress/Tests/WP/AlternativeFunctionsUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function getWarningList() {
8989
131 => 1,
9090
142 => 1,
9191
146 => 1,
92+
154 => 1,
9293
);
9394
}
9495
}

0 commit comments

Comments
 (0)