Skip to content

Commit 97b2e96

Browse files
committed
WP/DeprecatedFunctions: add tests for namespaced names
1 parent e44ef89 commit 97b2e96

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
/*
4+
* Safeguard correct handling of all types of namespaced function calls.
5+
*/
6+
\the_category_ID();
7+
MyNamespace\the_category_ID();
8+
\MyNamespace\the_category_ID();
9+
namespace\the_category_ID(); // The sniff should start flagging this once it can resolve relative namespaces.

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public function getErrorList( $testFile = '' ) {
8989

9090
return $errors;
9191

92+
case 'DeprecatedFunctionsUnitTest.2.inc':
93+
return array(
94+
6 => 1,
95+
);
96+
9297
default:
9398
return array();
9499
}

0 commit comments

Comments
 (0)