Skip to content

Commit 8b850ea

Browse files
committed
Tests: Remove unneeded final cleanup from taxonomy tests.
Three `Tests_Taxonomy` tests removed their taxonomy from the global registry after their last assertion. The per-test reset already unregisters custom taxonomies, so these lines protected nothing. Another test unregistered `wptests_pt`, a post type it never registers. Developed in: #14952 Props rejaulalomkhan, huzaifaalmesbah, mukesh27. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@65232 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6352c62 commit 8b850ea

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

‎tests/phpunit/tests/taxonomy.php‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ public function test_register_taxonomy() {
210210
register_taxonomy( $tax, 'post' );
211211
$this->assertTrue( taxonomy_exists( $tax ) );
212212
$this->assertFalse( is_taxonomy_hierarchical( $tax ) );
213-
214-
// Clean up.
215-
unset( $GLOBALS['wp_taxonomies'][ $tax ] );
216213
}
217214

218215
public function test_register_hierarchical_taxonomy() {
@@ -224,9 +221,6 @@ public function test_register_hierarchical_taxonomy() {
224221
register_taxonomy( $tax, 'post', array( 'hierarchical' => true ) );
225222
$this->assertTrue( taxonomy_exists( $tax ) );
226223
$this->assertTrue( is_taxonomy_hierarchical( $tax ) );
227-
228-
// Clean up.
229-
unset( $GLOBALS['wp_taxonomies'][ $tax ] );
230224
}
231225

232226
/**
@@ -341,7 +335,6 @@ public function test_registering_taxonomies_to_object_types() {
341335
$this->assertFalse( register_taxonomy_for_object_type( $tax, 'user' ) );
342336
$this->assertFalse( unregister_taxonomy_for_object_type( $tax, 'user' ) );
343337

344-
unset( $GLOBALS['wp_taxonomies'][ $tax ] );
345338
_unregister_post_type( $post_type );
346339
}
347340

@@ -646,7 +639,6 @@ public function test_get_ancestors_taxonomy_post_type_conflict_resource_type_tax
646639
$this->assertSameSets( array( $p1 ), get_ancestors( $p2, 'wptests_conflict', 'post_type' ) );
647640
$this->assertSameSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict', 'taxonomy' ) );
648641
$this->assertSameSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict' ) );
649-
_unregister_post_type( 'wptests_pt' );
650642
}
651643

652644
/**

0 commit comments

Comments
 (0)