From af0c73b10b0fdfb2c14f880c2e245e3419e4a1b1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 31 May 2019 14:06:27 +0000 Subject: [PATCH] Build/Test Tools: Add `$current_screen` to the list of globals to unset in `WP_UnitTestCase_Base::go_to()`. Props mauteri. Fixes #47439. git-svn-id: https://develop.svn.wordpress.org/trunk@45486 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 c953aa5539..9ee08e2260 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -707,7 +707,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Framework_TestCase { // from all over the place (globals, GET, etc), which makes it tricky // to run them more than once without very carefully clearing everything $_GET = $_POST = array(); - foreach ( array( 'query_string', 'id', 'postdata', 'authordata', 'day', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages', 'pagenow' ) as $v ) { + foreach ( array( 'query_string', 'id', 'postdata', 'authordata', 'day', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages', 'pagenow', 'current_screen' ) as $v ) { if ( isset( $GLOBALS[ $v ] ) ) { unset( $GLOBALS[ $v ] ); }