From 8a4ffe388300701a0205d7d3ca9ea8fa4e861031 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 3 Nov 2021 02:56:27 +0000 Subject: [PATCH] Tests: Clean up the `$_REQUEST` superglobal in `WP_UnitTestCase_Base::clean_up_global_scope()`. This resolves an issue where setting up `$_REQUEST['post_type']` and not clearing it afterwards in `Tests_Admin_IncludesScreen::setup_block_editor_test()` started affecting a few `WP_Comments_List_Table` tests after [51997]. It also ensures a similar issue does not inadvertently happen in other tests. Follow-up to [760/tests], [51997]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51999 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/abstract-testcase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 3cfe3991ea..765b514aa9 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -193,8 +193,9 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase { * Cleans the global scope (e.g `$_GET` and `$_POST`). */ public function clean_up_global_scope() { - $_GET = array(); - $_POST = array(); + $_GET = array(); + $_POST = array(); + $_REQUEST = array(); self::flush_cache(); }