Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite.

The parent method should be called after any test-specific teardown.

See #52625


git-svn-id: https://develop.svn.wordpress.org/trunk@50450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2021-02-27 17:08:26 +00:00
parent 3542c3b4c0
commit 055deeabff
29 changed files with 43 additions and 47 deletions
+1 -1
View File
@@ -157,7 +157,6 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
* Resets $_POST, removes the wp_die() override, restores error reporting.
*/
public function tearDown() {
parent::tearDown();
$_POST = array();
$_GET = array();
unset( $GLOBALS['post'] );
@@ -166,6 +165,7 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
remove_action( 'clear_auth_cookie', array( $this, 'logout' ) );
error_reporting( $this->_error_level );
set_current_screen( 'front' );
parent::tearDown();
}
/**