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

WordPress Trac noreply at wordpress.org
Sun Oct 30 02:52:18 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:"54723" 54723]:
 {{{
 #!CommitTicketReference repository="" revision="54723"
 Tests: Correctly restore the `wp_installing()` status in Ajax tests.

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

 Since the subsequent `wp_installing( false )` call was in the same `try {
 ... }` block, it could not be executed if an exception was thrown,
 affecting other tests.

 In this case, after rearranging the Ajax tests in [54722], this started
 affecting the `get_site_option()` calls in the tests for
 `wp_ajax_wp_compression_test()`.

 By moving both `wp_installing()` calls out of the `try`/`catch` block, we
 can ensure the status is correctly restored.

 Follow-up to [734/tests], [37150], [38168], [38710], [54722].

 See #56793.
 }}}

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


More information about the wp-trac mailing list