diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index c87e5e7fd077c..5c5f9b3e19165 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -207,7 +207,7 @@ public function tear_down() { } // Reset comment globals. - $comment_globals = array( 'comment_alt', 'comment_depth', 'comment_thread_alt' ); + $comment_globals = array( 'comment_alt', 'comment_depth', 'comment_thread_alt', 'in_comment_loop' ); foreach ( $comment_globals as $global ) { $GLOBALS[ $global ] = null; } diff --git a/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php b/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php index ee964d96d9de0..043d38869e5e6 100644 --- a/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php +++ b/tests/phpunit/tests/comment/getCommentAuthorUrlLink.php @@ -9,6 +9,12 @@ class Tests_Comment_GetCommentAuthorUrlLink extends WP_UnitTestCase { protected static $comments = array(); + public function tear_down() { + unset( $GLOBALS['comment'] ); + + parent::tear_down(); + } + public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { unset( $GLOBALS['comment'] );