Skip to content

Commit 2d84659

Browse files
committed
Tests: Clean up custom taxonomies in term tests.
Unregister `wptests_tax` and `wptests_tax2` in the relevant term link and term description test teardown methods. Clean up the class-level taxonomy fixture after the term link tests. Developed in: #14924 Props huzaifaalmesbah. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@64845 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e0ef8cb commit 2d84659

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎tests/phpunit/tests/term/getTermLink.php‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,22 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
1717
}
1818
}
1919

20+
public static function wpTearDownAfterClass() {
21+
unregister_taxonomy( 'wptests_tax' );
22+
}
23+
2024
public function set_up() {
2125
parent::set_up();
2226
self::register_custom_taxonomy();
2327
}
2428

29+
public function tear_down() {
30+
unregister_taxonomy( 'wptests_tax' );
31+
unregister_taxonomy( 'wptests_tax2' );
32+
33+
parent::tear_down();
34+
}
35+
2536
/**
2637
* Helper to register a custom taxonomy for use in tests.
2738
*

‎tests/phpunit/tests/term/termDescription.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
4646
);
4747
}
4848

49+
public function tear_down() {
50+
unregister_taxonomy( 'wptests_tax' );
51+
52+
parent::tear_down();
53+
}
54+
4955
/**
5056
* Tests that term_description() returns the formatted description for a given term ID.
5157
*

0 commit comments

Comments
 (0)