[wp-trac] [WordPress Trac] #65301: Remove redundant remove_filter()/remove_action() calls in abilities test coverage

WordPress Trac noreply at wordpress.org
Thu May 21 23:20:51 UTC 2026


#65301: Remove redundant remove_filter()/remove_action() calls in abilities test
coverage
--------------------------------------+-----------------------------
 Reporter:  gziolo                    |       Owner:  SergeyBiryukov
     Type:  task (blessed)            |      Status:  closed
 Priority:  normal                    |   Milestone:  7.1
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"62405" 62405]:
 {{{
 #!CommitTicketReference repository="" revision="62405"
 Tests: Get rid of extra `remove_filter()`/`remove_action()` calls in
 Abilities API tests.

 These are redundant: `WP_UnitTestCase_Base::tear_down()` runs
 `::_restore_hooks()`, which restores `$wp_filter`/`$wp_actions` to a pre-
 test baseline, so hooks added during a test are removed automatically.

 Follow-up to [61032].

 Props mohamedahamed, gziolo, westonruter, SergeyBiryukov.
 Fixes #65301.
 }}}

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


More information about the wp-trac mailing list