Skip to content

Commit 6051199

Browse files
committed
WP/DeprecatedParameterValues: add tests for namespaced names
1 parent 574cff4 commit 6051199

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

WordPress/Tests/WP/DeprecatedParameterValuesUnitTest.1.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,11 @@ update_option(autoload: true, value: $value, option: 'blacklist_keys');
5454
wp_get_typography_font_size_value( $preset, array() ); // OK.
5555
wp_get_typography_font_size_value( $preset, true ); // Error.
5656
wp_get_typography_font_size_value( $preset, false ); // Error.
57+
58+
/*
59+
* Safeguard correct handling of all types of namespaced function calls.
60+
*/
61+
\get_bloginfo( 'home' ); // Bad.
62+
MyNamespace\get_bloginfo( 'home' ); // Ok.
63+
\MyNamespace\get_bloginfo( 'home' ); // Ok.
64+
namespace\get_bloginfo( 'home' ); // The sniff should start flagging this once it can resolve relative namespaces.

WordPress/Tests/WP/DeprecatedParameterValuesUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function getErrorList( $testFile = '' ) {
5656
49 => 1,
5757
50 => 1,
5858
51 => 1,
59+
61 => 1,
5960
);
6061

6162
default:

0 commit comments

Comments
 (0)