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

WordPress Trac noreply at wordpress.org
Wed Aug 2 17:58:35 UTC 2023


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

Comment (by hellofromTonya):

 In [changeset:"56348" 56348]:
 {{{
 #!CommitTicketReference repository="" revision="56348"
 Tests: Fix leakage in WP_List_Table tests.

 Fixes `WP_List_table` tests leaking into other tests by:

 * Restores the original `$hook_suffix` global value.
 Rather than modifying the global for all tests, it now restores the
 original value between tests. Why? To ensure each test starts at a known
 state.

 * Uses a new instance of `WP_List_Table` for each test.
 A test may modify the `$list_table` object. If it does, it could impact
 tests yet to run. By instantiating a new instance in the `set_up()` test
 fixture, each test is isolated from the others.

 Follow-up to [53868], [54215].

 Props hellofromTonya, antonvlasenko.
 See #58955, #58896.
 }}}

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


More information about the wp-trac mailing list