From 66f9609763c9fe89960f3b9948c48b15cd4dd65b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Oct 2017 21:47:39 +0000 Subject: [PATCH] Build/Test Tools: Clean up `$_REQUEST` and `$GLOBALS` after modifying them in `_test_list_hierarchical_page()`. Props birgire. Fixes #42044. git-svn-id: https://develop.svn.wordpress.org/trunk@41929 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/admin/includesListTable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/tests/admin/includesListTable.php b/tests/phpunit/tests/admin/includesListTable.php index cf40457cdf..2fa8460b17 100644 --- a/tests/phpunit/tests/admin/includesListTable.php +++ b/tests/phpunit/tests/admin/includesListTable.php @@ -185,6 +185,10 @@ class Tests_Admin_includesListTable extends WP_UnitTestCase { $this->table->display_rows( $pages->posts ); $output = ob_get_clean(); + // Clean up. + unset( $_REQUEST['paged'] ); + unset( $GLOBALS['per_page'] ); + preg_match_all( '|]*>|', $output, $matches ); $this->assertCount( count( $expected_ids ), array_keys( $matches[0] ) );