From a87312aa2091d254f36e31a02a37b30b5890536d Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Wed, 19 Aug 2026 12:55:12 +0400 Subject: [PATCH 1/2] Tests: Reset global comment after author URL tests --- tests/phpunit/tests/comment/getCommentAuthorUrlLink.php | 6 ++++++ 1 file changed, 6 insertions(+) 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'] ); From b9f58b18f037f01b8ac3e10cbf02fd58afd84562 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 20 Aug 2026 10:53:49 +0400 Subject: [PATCH 2/2] Tests: Reset comment loop state between tests --- tests/phpunit/includes/abstract-testcase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }