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() {