diff --git a/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php b/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php index 245f3df79c..1e31396d2c 100644 --- a/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php +++ b/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php @@ -18,8 +18,6 @@ class Tests_Comment_GetCommentAuthorEmailLink extends WP_UnitTestCase { public function tearDown() { unset( $GLOBALS['comment'] ); parent::tearDown(); - - add_filter( 'comment_email', 'antispambot' ); } public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index a75371636b..29259d924f 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -35,14 +35,6 @@ class Tests_DB extends WP_UnitTestCase { add_filter( 'query', array( $this, 'query_filter' ) ); } - /** - * Tear down the test fixture - */ - public function tearDown() { - remove_filter( 'query', array( $this, 'query_filter' ) ); - parent::tearDown(); - } - /** * Log each query * diff --git a/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php b/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php index 01b2918bed..9e25158419 100644 --- a/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php +++ b/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php @@ -83,7 +83,6 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase { function tearDown() { $registry = WP_Block_Type_Registry::get_instance(); $registry->unregister( 'core/fake' ); - wp_delete_post( self::$post_id, true ); parent::tearDown(); } diff --git a/tests/phpunit/tests/formatting/redirect.php b/tests/phpunit/tests/formatting/redirect.php index 0b9fc31a2d..c3db98976e 100644 --- a/tests/phpunit/tests/formatting/redirect.php +++ b/tests/phpunit/tests/formatting/redirect.php @@ -11,11 +11,6 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { add_filter( 'home_url', array( $this, 'home_url' ) ); } - function tearDown() { - remove_filter( 'home_url', array( $this, 'home_url' ) ); - parent::tearDown(); - } - function home_url() { return 'http://example.com/'; } diff --git a/tests/phpunit/tests/functions/doEnclose.php b/tests/phpunit/tests/functions/doEnclose.php index b308798f73..768afa4f0f 100644 --- a/tests/phpunit/tests/functions/doEnclose.php +++ b/tests/phpunit/tests/functions/doEnclose.php @@ -28,16 +28,6 @@ class Tests_Functions_DoEnclose extends WP_UnitTestCase { add_filter( 'pre_http_request', array( $this, 'fake_http_request' ), 10, 3 ); } - /** - * Cleanup after each test method. - * - * @since 5.3.0 - */ - public function tearDown() { - parent::tearDown(); - remove_filter( 'pre_http_request', array( $this, 'fake_http_request' ) ); - } - /** * Test the function with an explicit content input. * diff --git a/tests/phpunit/tests/general/wpGetDocumentTitle.php b/tests/phpunit/tests/general/wpGetDocumentTitle.php index d86fd537e5..af78a52a62 100644 --- a/tests/phpunit/tests/general/wpGetDocumentTitle.php +++ b/tests/phpunit/tests/general/wpGetDocumentTitle.php @@ -53,11 +53,6 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase { setup_postdata( get_post( self::$post_id ) ); } - function tearDown() { - wp_reset_postdata(); - parent::tearDown(); - } - function _add_title_tag_support() { add_theme_support( 'title-tag' ); } diff --git a/tests/phpunit/tests/general/wpResourceHints.php b/tests/phpunit/tests/general/wpResourceHints.php index a39d94d45b..4919945052 100644 --- a/tests/phpunit/tests/general/wpResourceHints.php +++ b/tests/phpunit/tests/general/wpResourceHints.php @@ -27,8 +27,6 @@ class Tests_General_wpResourceHints extends WP_UnitTestCase { function tearDown() { $GLOBALS['wp_scripts'] = $this->old_wp_scripts; $GLOBALS['wp_styles'] = $this->old_wp_styles; - add_action( 'wp_default_scripts', 'wp_default_scripts' ); - add_action( 'wp_default_styles', 'wp_default_styles' ); parent::tearDown(); } diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php index 274a0a297d..d93c3fb9fd 100644 --- a/tests/phpunit/tests/http/base.php +++ b/tests/phpunit/tests/http/base.php @@ -39,13 +39,6 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { } } - function tearDown() { - foreach ( array( 'curl', 'streams', 'fsockopen' ) as $t ) { - remove_filter( "use_{$t}_transport", '__return_false' ); - } - parent::tearDown(); - } - function filter_http_request_args( array $args ) { $this->http_request_args = $args; return $args; diff --git a/tests/phpunit/tests/http/wpGetHttpHeaders.php b/tests/phpunit/tests/http/wpGetHttpHeaders.php index 5611420402..9c6c025f03 100644 --- a/tests/phpunit/tests/http/wpGetHttpHeaders.php +++ b/tests/phpunit/tests/http/wpGetHttpHeaders.php @@ -16,16 +16,6 @@ class Tests_HTTP_wpGetHttpHeaders extends WP_UnitTestCase { add_filter( 'pre_http_request', array( $this, 'fake_http_request' ), 10, 3 ); } - /** - * Clean up environment - */ - public function tearDown() { - parent::tearDown(); - - // Clear the hook for the fake HTTP request response. - remove_filter( 'pre_http_request', array( $this, 'fake_http_request' ) ); - } - /** * Test with a valid URL */ diff --git a/tests/phpunit/tests/image/base.php b/tests/phpunit/tests/image/base.php index 6204709084..deaeaad33e 100644 --- a/tests/phpunit/tests/image/base.php +++ b/tests/phpunit/tests/image/base.php @@ -18,14 +18,6 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase { add_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 ); } - /** - * Undo the image editor override - */ - public function tearDown() { - remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 ); - parent::tearDown(); - } - /** * Override the image editor engine * diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php index e5f90858df..3e3255e6a5 100644 --- a/tests/phpunit/tests/image/resize.php +++ b/tests/phpunit/tests/image/resize.php @@ -16,12 +16,6 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) ); } - public function tearDown() { - remove_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) ); - - parent::tearDown(); - } - public function wp_image_editors() { return array( $this->editor_engine ); } diff --git a/tests/phpunit/tests/import/import.php b/tests/phpunit/tests/import/import.php index 0dfb60b369..87ababf7a6 100644 --- a/tests/phpunit/tests/import/import.php +++ b/tests/phpunit/tests/import/import.php @@ -33,12 +33,6 @@ class Tests_Import_Import extends WP_Import_UnitTestCase { } } - function tearDown() { - remove_filter( 'import_allow_create_users', '__return_true' ); - - parent::tearDown(); - } - function test_small_import() { global $wpdb; diff --git a/tests/phpunit/tests/l10n/getUserLocale.php b/tests/phpunit/tests/l10n/getUserLocale.php index 814a82ce2e..f1d6f3828a 100644 --- a/tests/phpunit/tests/l10n/getUserLocale.php +++ b/tests/phpunit/tests/l10n/getUserLocale.php @@ -21,7 +21,6 @@ class Tests_L10n_GetUserLocale extends WP_UnitTestCase { } public function tearDown() { - delete_user_meta( $this->user_id, 'locale' ); set_current_screen( 'front' ); parent::tearDown(); diff --git a/tests/phpunit/tests/l10n/loadTextdomain.php b/tests/phpunit/tests/l10n/loadTextdomain.php index 08be6b7cf7..ec54a0e6cd 100644 --- a/tests/phpunit/tests/l10n/loadTextdomain.php +++ b/tests/phpunit/tests/l10n/loadTextdomain.php @@ -26,13 +26,6 @@ class Tests_L10n_LoadTextdomain extends WP_UnitTestCase { add_filter( 'theme_locale', array( $this, 'store_locale' ) ); } - public function tearDown() { - remove_filter( 'plugin_locale', array( $this, 'store_locale' ) ); - remove_filter( 'theme_locale', array( $this, 'store_locale' ) ); - - parent::tearDown(); - } - public function store_locale( $locale ) { $this->locale = $locale; diff --git a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php index 42f8e7ea4d..814f6562c8 100644 --- a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php +++ b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php @@ -40,9 +40,6 @@ class Tests_L10n_LoadTextdomainJustInTime extends WP_UnitTestCase { public function tearDown() { $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; - remove_filter( 'theme_root', array( $this, 'filter_theme_root' ) ); - remove_filter( 'stylesheet_root', array( $this, 'filter_theme_root' ) ); - remove_filter( 'template_root', array( $this, 'filter_theme_root' ) ); wp_clean_themes_cache(); unset( $GLOBALS['wp_themes'] ); unset( $GLOBALS['l10n'] ); diff --git a/tests/phpunit/tests/multisite/getSpaceAllowed.php b/tests/phpunit/tests/multisite/getSpaceAllowed.php index b534d391be..a1c6678d76 100644 --- a/tests/phpunit/tests/multisite/getSpaceAllowed.php +++ b/tests/phpunit/tests/multisite/getSpaceAllowed.php @@ -10,16 +10,6 @@ if ( is_multisite() ) : class Tests_Multisite_Get_Space_Allowed extends WP_UnitTestCase { protected $suppress = false; - protected static $original_site_blog_upload_space; - protected static $original_blog_upload_space; - - public static function setUpBeforeClass() { - parent::setUpBeforeClass(); - - self::$original_site_blog_upload_space = get_site_option( 'blog_upload_space' ); - self::$original_blog_upload_space = get_option( 'blog_upload_space' ); - } - public function setUp() { global $wpdb; parent::setUp(); @@ -29,13 +19,6 @@ if ( is_multisite() ) : public function tearDown() { global $wpdb; - /** - * Reset the two `blog_upload_space` options to their original values so - * they can be relied on in other test classes. - */ - update_site_option( 'blog_upload_space', self::$original_site_blog_upload_space ); - update_option( 'blog_upload_space', self::$original_blog_upload_space ); - $wpdb->suppress_errors( $this->suppress ); parent::tearDown(); } diff --git a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php index d8a79031ef..5abe85f9d4 100644 --- a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php +++ b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php @@ -13,16 +13,6 @@ if ( is_multisite() ) : class Tests_Multisite_Is_Upload_Space_Available extends WP_UnitTestCase { protected $suppress = false; - protected static $original_site_blog_upload_space; - protected static $original_blog_upload_space; - - public static function setUpBeforeClass() { - parent::setUpBeforeClass(); - - self::$original_site_blog_upload_space = get_site_option( 'blog_upload_space' ); - self::$original_blog_upload_space = get_option( 'blog_upload_space' ); - } - public function setUp() { global $wpdb; parent::setUp(); @@ -34,13 +24,6 @@ if ( is_multisite() ) : public function tearDown() { global $wpdb; - /** - * Reset the two `blog_upload_space` options to their original values so - * they can be relied on in other test classes. - */ - update_site_option( 'blog_upload_space', self::$original_site_blog_upload_space ); - update_option( 'blog_upload_space', self::$original_blog_upload_space ); - $wpdb->suppress_errors( $this->suppress ); parent::tearDown(); } diff --git a/tests/phpunit/tests/multisite/ms-files-rewriting.php b/tests/phpunit/tests/multisite/ms-files-rewriting.php index c7a8e7b8e3..dd0f3560db 100644 --- a/tests/phpunit/tests/multisite/ms-files-rewriting.php +++ b/tests/phpunit/tests/multisite/ms-files-rewriting.php @@ -26,7 +26,6 @@ if ( is_multisite() ) : function tearDown() { global $wpdb; - update_site_option( 'ms_files_rewriting', 0 ); $wpdb->suppress_errors( $this->suppress ); parent::tearDown(); diff --git a/tests/phpunit/tests/oembed/controller.php b/tests/phpunit/tests/oembed/controller.php index d6be39409b..de4548a63a 100644 --- a/tests/phpunit/tests/oembed/controller.php +++ b/tests/phpunit/tests/oembed/controller.php @@ -64,8 +64,6 @@ class Test_oEmbed_Controller extends WP_UnitTestCase { global $wp_rest_server; $wp_rest_server = null; - remove_filter( 'pre_http_request', array( $this, 'mock_embed_request' ), 10 ); - remove_filter( 'oembed_result', array( $this, 'filter_oembed_result' ), 10 ); parent::tearDown(); } diff --git a/tests/phpunit/tests/post/revisions.php b/tests/phpunit/tests/post/revisions.php index 95efe83578..7883483e40 100644 --- a/tests/phpunit/tests/post/revisions.php +++ b/tests/phpunit/tests/post/revisions.php @@ -20,11 +20,6 @@ class Tests_Post_Revisions extends WP_UnitTestCase { $this->post_type = rand_str( 20 ); } - function tearDown() { - unset( $GLOBALS['wp_post_types'][ $this->post_type ] ); - parent::tearDown(); - } - /** * Note: Test needs reviewing when #16215 is fixed because I'm not sure the test current tests the "correct" behavior * diff --git a/tests/phpunit/tests/query/isTerm.php b/tests/phpunit/tests/query/isTerm.php index 1de8c522e9..77d7a597d9 100644 --- a/tests/phpunit/tests/query/isTerm.php +++ b/tests/phpunit/tests/query/isTerm.php @@ -65,17 +65,6 @@ class Tests_Query_IsTerm extends WP_UnitTestCase { add_action( 'pre_get_posts', array( $this, 'pre_get_posts_tax_category_tax_query' ) ); } - function tearDown() { - global $wp_rewrite; - - _unregister_taxonomy( 'testtax' ); - - $wp_rewrite->init(); - - remove_action( 'pre_get_posts', array( $this, 'pre_get_posts_tax_category_tax_query' ) ); - parent::tearDown(); - } - function test_tag_action_tax() { // Tag with taxonomy added. $this->go_to( home_url( '/tag/tag-slug/' ) ); diff --git a/tests/phpunit/tests/query/search.php b/tests/phpunit/tests/query/search.php index c1c74c8240..b70bdc6d44 100644 --- a/tests/phpunit/tests/query/search.php +++ b/tests/phpunit/tests/query/search.php @@ -17,7 +17,6 @@ class Tests_Query_Search extends WP_UnitTestCase { } function tearDown() { - _unregister_post_type( $this->post_type ); unset( $this->q ); parent::tearDown(); diff --git a/tests/phpunit/tests/rest-api/rest-attachments-controller.php b/tests/phpunit/tests/rest-api/rest-attachments-controller.php index fe3c669c17..16cbcb61c8 100644 --- a/tests/phpunit/tests/rest-api/rest-attachments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-attachments-controller.php @@ -95,9 +95,6 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control unlink( $this->test_file2 ); } - remove_action( 'rest_insert_attachment', array( $this, 'filter_rest_insert_attachment' ) ); - remove_action( 'rest_after_insert_attachment', array( $this, 'filter_rest_after_insert_attachment' ) ); - $this->remove_added_uploads(); if ( class_exists( WP_Image_Editor_Mock::class ) ) { diff --git a/tests/phpunit/tests/rest-api/rest-categories-controller.php b/tests/phpunit/tests/rest-api/rest-categories-controller.php index 5bd0d03a43..35ff944125 100644 --- a/tests/phpunit/tests/rest-api/rest-categories-controller.php +++ b/tests/phpunit/tests/rest-api/rest-categories-controller.php @@ -1182,12 +1182,6 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas return 123; } - public function tearDown() { - _unregister_taxonomy( 'batman' ); - _unregister_taxonomy( 'robin' ); - parent::tearDown(); - } - protected function check_get_taxonomy_terms_response( $response ) { $this->assertSame( 200, $response->get_status() ); $data = $response->get_data(); diff --git a/tests/phpunit/tests/rest-api/rest-pages-controller.php b/tests/phpunit/tests/rest-api/rest-pages-controller.php index 902272d7a1..6c524a10c2 100644 --- a/tests/phpunit/tests/rest-api/rest-pages-controller.php +++ b/tests/phpunit/tests/rest-api/rest-pages-controller.php @@ -764,11 +764,6 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertArrayHasKey( 'type', $properties ); } - public function tearDown() { - parent::tearDown(); - remove_filter( 'theme_page_templates', array( $this, 'filter_theme_page_templates' ) ); - } - public function filter_theme_page_templates( $page_templates ) { return array( 'page-my-test-template.php' => 'My Test Template', diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index 2d0e1767d0..7c0392dd27 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -5088,13 +5088,10 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te } public function tearDown() { - _unregister_post_type( 'private-post' ); - _unregister_post_type( 'youseeme' ); if ( isset( $this->attachment_id ) ) { $this->remove_added_uploads(); } - remove_filter( 'rest_pre_dispatch', array( $this, 'wpSetUpBeforeRequest' ), 10, 3 ); - remove_filter( 'posts_clauses', array( $this, 'save_posts_clauses' ), 10, 2 ); + parent::tearDown(); } diff --git a/tests/phpunit/tests/rest-api/rest-revisions-controller.php b/tests/phpunit/tests/rest-api/rest-revisions-controller.php index a1e982b8be..5bd08ec914 100644 --- a/tests/phpunit/tests/rest-api/rest-revisions-controller.php +++ b/tests/phpunit/tests/rest-api/rest-revisions-controller.php @@ -76,12 +76,6 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase $this->revision_id3 = $this->revision_3->ID; } - public function tearDown() { - parent::tearDown(); - - remove_filter( 'map_meta_cap', array( $this, '_filter_map_meta_cap_remove_no_allow_revisions' ) ); - } - public function _filter_map_meta_cap_remove_no_allow_revisions( $caps, $cap, $user_id, $args ) { if ( 'delete_post' !== $cap || empty( $args ) ) { return $caps; diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index 5f9bf079e2..3d0628d7ee 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -31,7 +31,6 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { global $wp_rest_server; $wp_rest_server = null; - remove_filter( 'pre_http_request', array( $this, 'mock_embed_request' ), 10, 3 ); parent::tearDown(); } diff --git a/tests/phpunit/tests/rest-api/rest-tags-controller.php b/tests/phpunit/tests/rest-api/rest-tags-controller.php index 7d62f67282..83bb34517f 100644 --- a/tests/phpunit/tests/rest-api/rest-tags-controller.php +++ b/tests/phpunit/tests/rest-api/rest-tags-controller.php @@ -1400,12 +1400,6 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase { } } - public function tearDown() { - _unregister_taxonomy( 'batman' ); - _unregister_taxonomy( 'robin' ); - parent::tearDown(); - } - protected function check_get_taxonomy_terms_response( $response ) { $this->assertSame( 200, $response->get_status() ); $data = $response->get_data(); diff --git a/tests/phpunit/tests/rewrite/numericSlugs.php b/tests/phpunit/tests/rewrite/numericSlugs.php index 98f1368d42..1c547edea4 100644 --- a/tests/phpunit/tests/rewrite/numericSlugs.php +++ b/tests/phpunit/tests/rewrite/numericSlugs.php @@ -15,11 +15,6 @@ class Tests_Rewrite_NumericSlugs extends WP_UnitTestCase { add_filter( 'wp_unique_post_slug', array( $this, 'filter_unique_post_slug' ), 10, 6 ); } - public function tearDown() { - parent::tearDown(); - remove_filter( 'wp_unique_post_slug', array( $this, 'filter_unique_post_slug' ), 10, 6 ); - } - public function test_go_to_year_segment_collision_without_title() { global $wpdb; $this->set_permalink_structure( '/%postname%/' ); diff --git a/tests/phpunit/tests/rewrite/oldSlugRedirect.php b/tests/phpunit/tests/rewrite/oldSlugRedirect.php index 7177cbfa1e..724e698bb1 100644 --- a/tests/phpunit/tests/rewrite/oldSlugRedirect.php +++ b/tests/phpunit/tests/rewrite/oldSlugRedirect.php @@ -32,7 +32,6 @@ class Tests_Rewrite_OldSlugRedirect extends WP_UnitTestCase { public function tearDown() { $this->old_slug_redirect_url = null; - remove_filter( 'old_slug_redirect_url', array( $this, 'filter_old_slug_redirect_url' ), 10 ); parent::tearDown(); } diff --git a/tests/phpunit/tests/rewrite/rewriteTags.php b/tests/phpunit/tests/rewrite/rewriteTags.php index 402f5ed4c6..5afd25728a 100644 --- a/tests/phpunit/tests/rewrite/rewriteTags.php +++ b/tests/phpunit/tests/rewrite/rewriteTags.php @@ -7,14 +7,12 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { protected $rewritecode; protected $rewritereplace; protected $queryreplace; - protected $wp_rewrite; public function setUp() { global $wp_rewrite; parent::setUp(); - $this->wp_rewrite = $wp_rewrite; - $wp_rewrite = new WP_Rewrite(); + $wp_rewrite = new WP_Rewrite(); $wp_rewrite->init(); $this->rewritecode = $wp_rewrite->rewritecode; @@ -22,11 +20,6 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { $this->queryreplace = $wp_rewrite->queryreplace; } - public function tearDown() { - global $wp_rewrite; - $wp_rewrite = $this->wp_rewrite; - } - public function _invalid_rewrite_tags() { return array( array( 'foo', 'bar' ), diff --git a/tests/phpunit/tests/theme/WPTheme.php b/tests/phpunit/tests/theme/WPTheme.php index 28edec92ed..f738ad2052 100644 --- a/tests/phpunit/tests/theme/WPTheme.php +++ b/tests/phpunit/tests/theme/WPTheme.php @@ -20,9 +20,6 @@ class Tests_Theme_WPTheme extends WP_UnitTestCase { function tearDown() { $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; - remove_filter( 'theme_root', array( $this, '_theme_root' ) ); - remove_filter( 'stylesheet_root', array( $this, '_theme_root' ) ); - remove_filter( 'template_root', array( $this, '_theme_root' ) ); wp_clean_themes_cache(); unset( $GLOBALS['wp_themes'] ); parent::tearDown(); diff --git a/tests/phpunit/tests/theme/themeDir.php b/tests/phpunit/tests/theme/themeDir.php index ae02c39008..b2a2542895 100644 --- a/tests/phpunit/tests/theme/themeDir.php +++ b/tests/phpunit/tests/theme/themeDir.php @@ -26,9 +26,6 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase { function tearDown() { $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; - remove_filter( 'theme_root', array( $this, '_theme_root' ) ); - remove_filter( 'stylesheet_root', array( $this, '_theme_root' ) ); - remove_filter( 'template_root', array( $this, '_theme_root' ) ); wp_clean_themes_cache(); unset( $GLOBALS['wp_themes'] ); parent::tearDown(); diff --git a/tests/phpunit/tests/user/author.php b/tests/phpunit/tests/user/author.php index 0cae9b2bcb..21aa9f6b52 100644 --- a/tests/phpunit/tests/user/author.php +++ b/tests/phpunit/tests/user/author.php @@ -39,11 +39,6 @@ class Tests_User_Author_Template extends WP_UnitTestCase { setup_postdata( get_post( self::$post_id ) ); } - function tearDown() { - wp_reset_postdata(); - parent::tearDown(); - } - function test_get_the_author() { $author_name = get_the_author(); $user = new WP_User( self::$author_id ); diff --git a/tests/phpunit/tests/user/countUserPosts.php b/tests/phpunit/tests/user/countUserPosts.php index 7c6886dd0c..0e18f938aa 100644 --- a/tests/phpunit/tests/user/countUserPosts.php +++ b/tests/phpunit/tests/user/countUserPosts.php @@ -58,11 +58,6 @@ class Tests_User_CountUserPosts extends WP_UnitTestCase { register_post_type( 'wptests_pt' ); } - public function tearDown() { - _unregister_post_type( 'wptests_pt' ); - parent::tearDown(); - } - public function test_count_user_posts_post_type_should_default_to_post() { $this->assertEquals( 4, count_user_posts( self::$user_id ) ); } diff --git a/tests/phpunit/tests/user/wpSendUserRequest.php b/tests/phpunit/tests/user/wpSendUserRequest.php index 7a8ea6bbd7..0b4d19af80 100644 --- a/tests/phpunit/tests/user/wpSendUserRequest.php +++ b/tests/phpunit/tests/user/wpSendUserRequest.php @@ -76,7 +76,6 @@ class Tests_User_WpSendUserRequest extends WP_UnitTestCase { * @since 4.9.9 */ public function tearDown() { - delete_option( 'WPLANG' ); reset_phpmailer_instance(); unset( $GLOBALS['locale'] ); diff --git a/tests/phpunit/tests/xmlrpc/wp/getPostType.php b/tests/phpunit/tests/xmlrpc/wp/getPostType.php index cfff2320fc..5c0f4ddb19 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getPostType.php +++ b/tests/phpunit/tests/xmlrpc/wp/getPostType.php @@ -23,12 +23,6 @@ class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase { register_post_type( $this->cpt_name, $this->cpt_args ); } - function tearDown() { - _unregister_post_type( $this->cpt_name ); - - parent::tearDown(); - } - function test_invalid_username_password() { $result = $this->myxmlrpcserver->wp_getPostType( array( 1, 'username', 'password', 'post' ) ); $this->assertIXRError( $result ); diff --git a/tests/phpunit/tests/xmlrpc/wp/getUser.php b/tests/phpunit/tests/xmlrpc/wp/getUser.php index 9412dea89b..48f2b69494 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getUser.php +++ b/tests/phpunit/tests/xmlrpc/wp/getUser.php @@ -17,13 +17,6 @@ class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase { } } - function tearDown() { - if ( is_multisite() ) { - revoke_super_admin( $this->administrator_id ); - } - parent::tearDown(); - } - function test_invalid_username_password() { $result = $this->myxmlrpcserver->wp_getUser( array( 1, 'username', 'password', 1 ) ); $this->assertIXRError( $result );