Skip to content

Commit 0256b04

Browse files
committed
Tests: Clean up post status and taxonomy fixtures.
Unregister the custom `foo` post status after the `get_pages()` tests. Unregister custom taxonomies after object-term removal, tag-cloud widget, XML-RPC term, and unique term slug tests. Preserve parent teardown and clean up registrations before subsequent class fixtures run. Developed in: #15056, #15057, #15058, #15059, #15060 Props rejaulalomkhan, mukesh27. See #65893. git-svn-id: https://develop.svn.wordpress.org/trunk@65019 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1825825 commit 0256b04

5 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎tests/phpunit/tests/post/getPages.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
4343
}
4444

4545
public function tear_down() {
46+
_unregister_post_status( 'foo' );
4647
unregister_post_type( 'wptests_pt' );
4748

4849
parent::tear_down();

‎tests/phpunit/tests/term/wpRemoveObjectTerms.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
* @group taxonomy
55
*/
66
class Tests_Term_WpRemoveObjectTerms extends WP_UnitTestCase {
7+
public function tear_down() {
8+
unregister_taxonomy( 'wptests_tax' );
9+
parent::tear_down();
10+
}
11+
712
/**
813
* @ticket 34338
914
*/

‎tests/phpunit/tests/term/wpUniqueTermSlug.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ public function set_up() {
1010
register_taxonomy( 'wptests_tax2', 'post', array( 'hierarchical' => true ) );
1111
}
1212

13+
public function tear_down() {
14+
unregister_taxonomy( 'wptests_tax1' );
15+
unregister_taxonomy( 'wptests_tax2' );
16+
17+
parent::tear_down();
18+
}
19+
1320
public function test_unique_slug_should_be_unchanged() {
1421
$term = self::factory()->term->create_and_get(
1522
array(

‎tests/phpunit/tests/widgets/wpWidgetTagCloud.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
*/
1616
class Tests_Widgets_wpWidgetTagCloud extends WP_UnitTestCase {
1717

18+
public function tear_down() {
19+
unregister_taxonomy( 'wptests_tax' );
20+
21+
parent::tear_down();
22+
}
23+
1824
/**
1925
* Default widget arguments.
2026
*

‎tests/phpunit/tests/xmlrpc/wp/getTerms.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
*/
66
class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase {
77

8+
public function tear_down() {
9+
unregister_taxonomy( 'wp_getTerms_custom_taxonomy' );
10+
parent::tear_down();
11+
}
12+
813
public function test_invalid_username_password() {
914
$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password', 'category' ) );
1015
$this->assertIXRError( $result );

0 commit comments

Comments
 (0)