Tests: Use a better return type check for parse_url() in do_enclose() tests.

Since the `pathinfo()` function accepts a string, checking for that specifically is more consistent with similar checks elsewhere in core.

Follow-up to [51606], [51622], [51626].

See #53635.

git-svn-id: https://develop.svn.wordpress.org/trunk@51627 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-08-17 00:27:38 +00:00
parent 5f5895bf61
commit 6d574d7cab

View File

@@ -280,7 +280,7 @@ class Tests_Functions_DoEnclose extends WP_UnitTestCase {
$path = parse_url( $url, PHP_URL_PATH );
if ( null !== $path ) {
if ( is_string( $path ) ) {
$extension = pathinfo( $path, PATHINFO_EXTENSION );
if ( isset( $fake_headers[ $extension ] ) ) {
return $fake_headers[ $extension ];