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
This commit is contained in:
Sergey Biryukov 2021-11-03 02:56:27 +00:00
parent b8dabaf249
commit 8a4ffe3883

View File

@ -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();
}