From 57bc3682303cb7bf8d8bf4c58458f412fc28d8bd Mon Sep 17 00:00:00 2001 From: Mario Santos Date: Fri, 20 Sep 2024 10:01:53 +0200 Subject: [PATCH] Improve tests readibility --- tests/phpunit/tests/link/getNextCommentsLink.php | 6 +++--- tests/phpunit/tests/link/getPreviousCommentsLink.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/link/getNextCommentsLink.php b/tests/phpunit/tests/link/getNextCommentsLink.php index 87296b8afd42e..dcb2aaa779c89 100644 --- a/tests/phpunit/tests/link/getNextCommentsLink.php +++ b/tests/phpunit/tests/link/getNextCommentsLink.php @@ -46,13 +46,13 @@ public function test_page_should_respect_value_of_page_argument() { $this->go_to( get_permalink( $p ) ); // Check setting the query var is ignored. - $cpage = get_query_var( 'cpage' ); + $old_cpage = get_query_var( 'cpage' ); set_query_var( 'cpage', 2 ); $link = get_next_comments_link( 'Next', 5, 3 ); - $this->assertStringContainsString( 'cpage=4', $link ); + set_query_var( 'cpage', $old_cpage ); - set_query_var( 'cpage', $cpage ); + $this->assertStringContainsString( 'cpage=4', $link ); } } diff --git a/tests/phpunit/tests/link/getPreviousCommentsLink.php b/tests/phpunit/tests/link/getPreviousCommentsLink.php index 43efd37bdeed8..f06a37e04db4d 100644 --- a/tests/phpunit/tests/link/getPreviousCommentsLink.php +++ b/tests/phpunit/tests/link/getPreviousCommentsLink.php @@ -44,13 +44,13 @@ public function test_page_should_respect_value_of_page_argument() { $this->go_to( get_permalink( $p ) ); // Check setting the query var is ignored. - $cpage = get_query_var( 'cpage' ); + $old_cpage = get_query_var( 'cpage' ); set_query_var( 'cpage', 4 ); $link = get_previous_comments_link( 'Previous', 3 ); - $this->assertStringContainsString( 'cpage=2', $link ); + set_query_var( 'cpage', $old_cpage ); - set_query_var( 'cpage', $cpage ); + $this->assertStringContainsString( 'cpage=2', $link ); } }