[wp-trac] [WordPress Trac] #58896: Fix WP_List_Table magic methods for PHP 8.2 dynamic properties

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


#58896: Fix WP_List_Table magic methods for PHP 8.2 dynamic properties
-------------------------------------------------+-------------------------
 Reporter:  antonvlasenko                        |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Administration                       |     Version:  4.0
 Severity:  normal                               |  Resolution:
 Keywords:  php82 has-patch has-unit-tests       |     Focuses:  php-
  commit                                         |  compatibility
-------------------------------------------------+-------------------------

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/58896#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list