[wp-trac] [WordPress Trac] #56793: Test tool and unit test improvements for 6.2

WordPress Trac noreply at wordpress.org
Sun Oct 30 03:49:09 UTC 2022


#56793: Test tool and unit test improvements for 6.2
------------------------------+---------------------
 Reporter:  desrosj           |       Owner:  (none)
     Type:  task (blessed)    |      Status:  new
 Priority:  normal            |   Milestone:  6.2
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"54725" 54725]:
 {{{
 #!CommitTicketReference repository="" revision="54725"
 Tests: Prevent `wp_update_themes()` from running in
 `wp_ajax_update_theme()` tests.

 In the tests for updating a theme via Ajax, `wp_installing( true )` is
 called to prevent `wp_update_themes()` from running.

 This worked as expected in `test_update_theme()`, however, it was missed
 in `test_uppercase_theme_slug()`, which was accidentally relying on the
 `wp_installing()` status not being properly restored in the previous test.

 Now that the `wp_installing()` status was corrected in [54723], the latter
 test started throwing an error on PHP 8.2:
 {{{
 1) Tests_Ajax_wpAjaxUpdateTheme::test_uppercase_theme_slug
 http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type
 string is deprecated

 /var/www/src/wp-includes/Requests/Transport/cURL.php:345
 /var/www/src/wp-includes/Requests/Transport/cURL.php:135
 /var/www/src/wp-includes/class-requests.php:381
 /var/www/src/wp-includes/class-wp-http.php:395
 /var/www/src/wp-includes/class-wp-http.php:615
 /var/www/src/wp-includes/http.php:179
 /var/www/src/wp-includes/update.php:719
 /var/www/src/wp-admin/includes/ajax-actions.php:4292
 /var/www/src/wp-includes/class-wp-hook.php:308
 /var/www/src/wp-includes/class-wp-hook.php:332
 /var/www/src/wp-includes/plugin.php:517
 /var/www/tests/phpunit/includes/testcase-ajax.php:265
 /var/www/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php:157
 }}}

 Replicating the `wp_installing()` status changes in this test too resolves
 the error.

 Follow-up to [38168], [38710], [54722], [54723].

 See #56793.
 }}}

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


More information about the wp-trac mailing list