From 9d5c7055e65ac702e8da4c080db237c7237e26a7 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 Oct 2015 01:03:16 +0000 Subject: [PATCH] Unit Tests: `Tests_Auth` needs a `tearDownAfterClass` impl to avoid spillage. See #30017, #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@35175 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/auth.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/phpunit/tests/auth.php b/tests/phpunit/tests/auth.php index 6fad9d2ab7..ab76f1e674 100644 --- a/tests/phpunit/tests/auth.php +++ b/tests/phpunit/tests/auth.php @@ -32,10 +32,23 @@ class Tests_Auth extends WP_UnitTestCase { self::commit_transaction(); } + public static function tearDownAfterClass() { + parent::tearDownAfterClass(); + + if ( is_multisite() ) { + wpmu_delete_user( self::$user_id ); + } else { + wp_delete_user( self::$user_id ); + } + + self::commit_transaction(); + } + function setUp() { parent::setUp(); $this->user = clone self::$_user; + wp_set_current_user( self::$user_id ); } function test_auth_cookie_valid() {