Skip to content

Commit e0ef8cb

Browse files
committed
Tests: Clean up fixtures in taxonomy tests.
Unregister the custom taxonomies and post type used by the object taxonomy and taxonomy visibility tests during teardown. Developed in: #14922 Props huzaifaalmesbah. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@64844 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0d4eca5 commit e0ef8cb

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎tests/phpunit/tests/taxonomy/getObjectTaxonomies.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ public function set_up() {
1010
register_taxonomy( 'wptests_tax', 'wptests_pt' );
1111
}
1212

13+
public function tear_down() {
14+
unregister_taxonomy( 'wptests_tax' );
15+
unregister_taxonomy( 'wptests_tax2' );
16+
unregister_post_type( 'wptests_pt' );
17+
18+
parent::tear_down();
19+
}
20+
1321
public function test_object_should_accept_string() {
1422
$found = get_object_taxonomies( 'wptests_pt' );
1523
$expected = array( 'wptests_tax' );

‎tests/phpunit/tests/taxonomy/isTaxonomyViewable.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ public function set_up() {
1212
register_taxonomy( 'wptests_tax_non_viewable', 'wptests_pt', array( 'publicly_queryable' => false ) );
1313
}
1414

15+
public function tear_down() {
16+
unregister_taxonomy( 'wptests_tax_viewable' );
17+
unregister_taxonomy( 'wptests_tax_non_viewable' );
18+
unregister_post_type( 'wptests_pt' );
19+
20+
parent::tear_down();
21+
}
22+
1523
/**
1624
* @ticket 44466
1725
*/

0 commit comments

Comments
 (0)