[wp-trac] [WordPress Trac] #62124: wp_parse_url() - code update for performance and removal of now unnecessary code fix

WordPress Trac noreply at wordpress.org
Fri Feb 28 19:10:10 UTC 2025


#62124: wp_parse_url() - code update for performance and removal of now unnecessary
code fix
--------------------------------------+-----------------------------
 Reporter:  wpseeddoctor              |       Owner:  pbearne
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  Future Release
Component:  HTTP API                  |     Version:  6.7
 Severity:  trivial                   |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+-----------------------------

Comment (by johnbillion):

 [https://github.com/WordPress/wordpress-develop/actions/runs/13528980150
 Here are the failing unit tests from the PR]:

 {{{
 There were 16 failures:

 1) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #0 ('http://example.com/', -1, array('http', 'example.com', '/'))
 Failed asserting that null is identical to Array &0 (
     'scheme' => 'http'
     'host' => 'example.com'
     'path' => '/'
 ).

 /var/www/tests/phpunit/tests/http/http.php:343
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 2) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #1 ('http://example.com/', -1, array('http', 'example.com', '/'))
 Failed asserting that null is identical to Array &0 (
     'scheme' => 'http'
     'host' => 'example.com'
     'path' => '/'
 ).

 /var/www/tests/phpunit/tests/http/http.php:343
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 3) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #2 ('http://example.com/', 1, 'example.com')
 Failed asserting that null is identical to 'example.com'.

 /var/www/tests/phpunit/tests/http/http.php:343
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 4) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #3 ('http://example.com/', 3, null)
 Unexpected deprecation notice for _get_component_from_parsed_url_array.
 Function _get_component_from_parsed_url_array is deprecated since version
 6.8.0 with no alternative available.
 Failed asserting that an array is empty.

 /var/www/tests/phpunit/includes/abstract-testcase.php:643
 /var/www/tests/phpunit/includes/abstract-testcase.php:655
 /var/www/vendor/yoast/phpunit-
 polyfills/src/TestCases/TestCasePHPUnitGte8.php:88
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 5) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #4 ('http:///example.com', -1, false)
 Failed asserting that null is identical to false.

 /var/www/tests/phpunit/tests/http/http.php:343
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 6) Tests_HTTP_HTTP::test_get_component_from_parsed_url_array with data set
 #5 ('http:///example.com', 1, null)
 Unexpected deprecation notice for _get_component_from_parsed_url_array.
 Function _get_component_from_parsed_url_array is deprecated since version
 6.8.0 with no alternative available.
 Failed asserting that an array is empty.

 /var/www/tests/phpunit/includes/abstract-testcase.php:643
 /var/www/tests/phpunit/includes/abstract-testcase.php:655
 /var/www/vendor/yoast/phpunit-
 polyfills/src/TestCases/TestCasePHPUnitGte8.php:88
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 7) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #0 (0, 'scheme')
 Failed asserting that null is identical to 'scheme'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 8) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #1 (1, 'host')
 Failed asserting that null is identical to 'host'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 9) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #2 (2, 'port')
 Failed asserting that null is identical to 'port'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 10) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #3 (3, 'user')
 Failed asserting that null is identical to 'user'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 11) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #4 (4, 'pass')
 Failed asserting that null is identical to 'pass'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 12) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #5 (5, 'path')
 Failed asserting that null is identical to 'path'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 13) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #6 (6, 'query')
 Failed asserting that null is identical to 'query'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 14) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #7 (7, 'fragment')
 Failed asserting that null is identical to 'fragment'.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 15) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #8 ('something', false)
 Failed asserting that null is identical to false.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118

 16) Tests_HTTP_HTTP::test_wp_translate_php_url_constant_to_key with data
 set #9 ('/var/www/src/', false)
 Failed asserting that null is identical to false.

 /var/www/tests/phpunit/tests/http/http.php:383
 phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
 /var/www/vendor/bin/phpunit:118
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62124#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list