Skip to content

Commit 34f4104

Browse files
committed
WP/GetMetaSingle: add tests for namespaced names
1 parent 6051199 commit 34f4104

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WordPress/Tests/WP/GetMetaSingleUnitTest.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ $warning = get_metadata(
4646
);
4747
$warning = get_metadata_raw( 'post', $post_id, $meta_key );
4848
$warning = get_metadata_default( 'post', $post_id, $meta_key );
49+
50+
/*
51+
* Safeguard correct handling of fully qualified and relative namespaced function calls (fully qualified global function
52+
* call and partially qualified namespaced function call are already handled above).
53+
*/
54+
\MyNamespace\get_post_meta( $post_id, $meta_key ); // Ok.
55+
namespace\get_post_meta( $post_id, $meta_key ); // The sniff should start flagging this once it can resolve relative namespaces.

0 commit comments

Comments
 (0)