diff --git a/tests/phpunit/tests/block-bindings/termDataSource.php b/tests/phpunit/tests/block-bindings/termDataSource.php index c8b95cedfc783..8a0f18bf02399 100644 --- a/tests/phpunit/tests/block-bindings/termDataSource.php +++ b/tests/phpunit/tests/block-bindings/termDataSource.php @@ -90,6 +90,15 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { add_filter( 'pre_term_description', 'wp_filter_kses' ); } + /** + * Tear down after each test. + */ + public function tear_down() { + unregister_taxonomy( 'wptests_private_tax' ); + + parent::tear_down(); + } + /** * Helper method to create a WP_Block instance. * @@ -449,8 +458,6 @@ public function test_get_value_non_publicly_queryable_taxonomy_unauthenticated() wp_set_current_user( 0 ); $this->assertNull( _block_bindings_term_data_get_value( array( 'field' => 'name' ), $block ) ); - - _unregister_taxonomy( 'wptests_private_tax' ); } /** @@ -482,8 +489,6 @@ public function test_get_value_non_publicly_queryable_taxonomy_with_read_capabil wp_set_current_user( $subscriber_id ); $this->assertSame( 'Secret Term', _block_bindings_term_data_get_value( array( 'field' => 'name' ), $block ) ); - - _unregister_taxonomy( 'wptests_private_tax' ); } /**