diff --git a/tests/phpunit/tests/category/getAllCategoryIds.php b/tests/phpunit/tests/category/getAllCategoryIds.php index 3fb8223afa060..a03d77492e92a 100644 --- a/tests/phpunit/tests/category/getAllCategoryIds.php +++ b/tests/phpunit/tests/category/getAllCategoryIds.php @@ -7,6 +7,15 @@ */ class Tests_Category_GetAllCategoryIds extends WP_UnitTestCase { + /** + * Tear down after each test. + */ + public function tear_down() { + unregister_taxonomy( 'test_tax_cat' ); + + parent::tear_down(); + } + /** * Validate get_all_category_ids * @@ -22,8 +31,6 @@ public function test_get_all_category_ids() { wp_insert_term( 'test1', 'test_tax_cat' ); $cat_ids = get_all_category_ids(); - _unregister_taxonomy( 'test_tax_cat' ); - // Validate length is 1 + created due to uncategorized. $this->assertCount( 3, $cat_ids ); }