[wp-trac] [WordPress Trac] #57236: Add $wp_filters to WP_UnitTestCase_Base::_backup_hooks() and ::_restore_hooks()

WordPress Trac noreply at wordpress.org
Wed Nov 30 21:20:41 UTC 2022


#57236: Add $wp_filters to WP_UnitTestCase_Base::_backup_hooks() and
::_restore_hooks()
------------------------------+----------------------------------------
 Reporter:  SergeyBiryukov    |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  6.2
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch good-first-bug
  Focuses:                    |
------------------------------+----------------------------------------
 Background: #28535, #35357.

 * [29251] / #28535 introduced saving the state of filter-related globals
 (`$wp_actions`, `$wp_current_filter`, and `$wp_filter`) between running
 individual unit tests, so that all tests initially use the same
 filters/actions.
 * [53803] / #35357 added a new global, `$wp_filters`. It should be reset
 too, along with `$wp_actions`.

 The change should be made in [source:tags/6.1.1/tests/phpunit/includes
 /abstract-testcase.php#L321 WP_UnitTestCase_Base::_backup_hooks()] and
 [source:tags/6.1.1/tests/phpunit/includes/abstract-testcase.php#L342
 ::_restore_hooks()].

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


More information about the wp-trac mailing list