[wp-trac] [WordPress Trac] #52566: wp_resource_hints() test failures when removing $pagenow global from get_home_url()

WordPress Trac noreply at wordpress.org
Thu Feb 18 10:26:03 UTC 2021


#52566: wp_resource_hints() test failures when removing $pagenow global from
get_home_url()
----------------------------+--------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.8
Component:  General         |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+--------------------
 Background: #52421

 After [50156], there were two test failures:
 {{{
 1)
 Tests_WP_Resource_Hints::test_dns_prefetch_scripts_does_not_included_registered_only
 Undefined index: pagenow

 /var/www/build/wp-includes/functions.wp-scripts.php:272
 /var/www/tests/phpunit/tests/general/resourceHints.php:192

 2) Tests_WP_Resource_Hints::test_deregistered_scripts_are_ignored
 Undefined index: pagenow

 /var/www/build/wp-includes/functions.wp-scripts.php:272
 /var/www/tests/phpunit/tests/general/resourceHints.php:205
 }}}

 Restoring the `$pagenow` global in [50164] have fixed them, but it's not
 quite clear why that happens, as the global is no longer used in the
 `get_home_url()` function.

 As noted by @peterwilsoncc in comment:9:ticket:52421, this could be either
 a poorly defined global in source, or erroneously reset global in the
 tests.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52566>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list