From a270d619ad96d043776c637cc7969be0c4700534 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 Oct 2015 01:05:50 +0000 Subject: [PATCH] Unit Tests: `Tests_Comment` needs a `tearDownAfterClass` impl to avoid spillage. See #30017, #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@35176 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/comment.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php index ff9c3b45ba..4befe0bd9b 100644 --- a/tests/phpunit/tests/comment.php +++ b/tests/phpunit/tests/comment.php @@ -20,6 +20,20 @@ class Tests_Comment extends WP_UnitTestCase { self::commit_transaction(); } + public static function tearDownAfterClass() { + parent::tearDownAfterClass(); + + wp_delete_post( self::$post_id ); + + if ( is_multisite() ) { + wpmu_delete_user( self::$user_id ); + } else { + wp_delete_user( self::$user_id ); + } + + self::commit_transaction(); + } + function test_wp_update_comment() { $post = $this->factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) ); $post2 = $this->factory->post->create_and_get( array( 'post_title' => 'some-post-2', 'post_type' => 'post' ) );