id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 28535,WP Unit Tests should reset hooks after each test,mnelson4,wonderboymusic,"After each unit test method is ran (Eg TEsts_Actions_Callbacks::test_callback_representations() ), the actions and filters set during that unit test preserved. This means that any filters added during one unit test will affect subsequent tests (which is troublesome because you can then have tests that fail because a hook was set on a previous test, but if you only run the unit test that failed (without the previous test that added the hook), it may pass.) I'm thinking the fix would be: add a global called something like $saved_wp_actions; During WP_UnitTestCase::setUp() copy the contents of $wp_actions to it. Then during WP_UnitTestCase::tearDown() restore $wp_actions to its previous state from before the test by assigning it to be equal to $saved_wp_actions.",enhancement,closed,normal,4.0,Build/Test Tools,4.0,normal,fixed,needs-patch,,