From 58cd3d80f382a8d6874f195e4e69c42c575f02ed Mon Sep 17 00:00:00 2001 From: Muhibul Haque Date: Thu, 5 Nov 2026 15:42:48 +0600 Subject: [PATCH] Tests: Clean up test_tax_cat custom taxonomy in Tests_Category_GetAllCategoryIds. See #65893. Props devmuhib009. --- tests/phpunit/tests/category/getAllCategoryIds.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 ); }