Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/phpunit/tests/term/getTerms.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ public function set_up() {
wp_cache_delete( 'last_changed', 'terms' );
}

public function tear_down() {
unregister_taxonomy( self::$taxonomy );
unregister_taxonomy( 'wptests_tax' );
unregister_taxonomy( 'wptests_tax1' );
unregister_taxonomy( 'wptests_tax2' );
unregister_taxonomy( 'wptests_tax_1' );
unregister_taxonomy( 'countries' );
unregister_taxonomy( 'hierarchical_fields' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several tests in this file register taxonomies through $tax, and they are not covered here: food (lines 567 and 668), deep (line 713) and location (lines 1151 and 1242). Could they be added to tear_down()?

unregister_taxonomy( 'food' );
unregister_taxonomy( 'deep' );
unregister_taxonomy( 'location' );

parent::tear_down();
}

public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
register_taxonomy( self::$taxonomy, 'page', array( 'hierarchical' => true ) );
$term_id1 = $factory->term->create(
Expand All @@ -38,6 +53,10 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
}
}

public static function wpTearDownAfterClass() {
unregister_taxonomy( self::$taxonomy );
}

/**
* @ticket 37568
*/
Expand Down
Loading