Skip to content

Commit bf36d36

Browse files
committed
Improve namespaced tests based on feedback in other PRs
1 parent 47a20bc commit bf36d36

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

WordPress/Tests/WP/AlternativeFunctionsUnitTest.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ file_get_contents( $local_file, true ); // OK.
3232
file_get_contents( $url, false ); // Warning.
3333
file_get_contents(); // OK - no params, so nothing to do.
3434
file_get_contents( 'http://remoteurl.com/file/?w=1' ); // Warning.
35-
file_get_contents( 'https://wordpress.org' ); // Warning.
35+
\file_GET_contents( 'https://wordpress.org' ); // Warning.
3636
file_get_contents(ABSPATH . 'wp-admin/css/some-file.css'); // OK.
3737
file_get_contents(MYABSPATH . 'plugin-file.json'); // Warning.
3838
file_get_contents( MUPLUGINDIR . 'some-file.xml' ); // OK.
@@ -152,9 +152,10 @@ file_get_contents(
152152
* Safeguard correct handling of all types of namespaced function calls
153153
*/
154154
\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.
155+
MyNamespace\parse_url( 'http://example.com/' );
156+
\MyNamespace\json_encode( $data );
157+
namespace\unlink(); // The sniff should start flagging this once it can resolve relative namespaces.
158+
namespace\Sub\strip_tags( $string );
158159

159160
/*
160161
* Safeguard that the sniff does not incorrectly ignore class methods/constants with the same

WordPress/Tests/WP/AlternativeFunctionsUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ public function getWarningList() {
9090
142 => 1,
9191
146 => 1,
9292
154 => 1,
93-
163 => 1,
9493
164 => 1,
9594
165 => 1,
9695
166 => 1,
9796
167 => 1,
9897
168 => 1,
98+
169 => 1,
9999
);
100100
}
101101
}

0 commit comments

Comments
 (0)