diff --git a/tests/phpunit/includes/testcase-ajax.php b/tests/phpunit/includes/testcase-ajax.php index e48647201f..b415976f21 100644 --- a/tests/phpunit/includes/testcase-ajax.php +++ b/tests/phpunit/includes/testcase-ajax.php @@ -50,21 +50,6 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase { 'wp-remove-post-lock', 'dismiss-wp-pointer', 'heartbeat', 'nopriv_heartbeat', ); - /** - * Don't preserve the global state when using an external object cache. - * - * Most of the Ajax tests are running in a separate PHP process, and thus PHPUnit attempts - * to preserve the global state from the parent process by serializing all globals. - * But this doesn't work for external object caches so we have to disable this "feature". - */ - public function run( PHPUnit_Framework_TestResult $result = NULL ) { - if ( wp_using_ext_object_cache() ) { - $this->setPreserveGlobalState( false ); - } - - return parent::run( $result ); - } - /** * Set up the test fixture. * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs diff --git a/tests/phpunit/tests/ajax/Autosave.php b/tests/phpunit/tests/ajax/Autosave.php index 512cbbd6e5..33cd79f1ba 100644 --- a/tests/phpunit/tests/ajax/Autosave.php +++ b/tests/phpunit/tests/ajax/Autosave.php @@ -12,7 +12,6 @@ require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); * @subpackage UnitTests * @since 3.4.0 * @group ajax - * @runTestsInSeparateProcesses */ class Tests_Ajax_Autosave extends WP_Ajax_UnitTestCase { diff --git a/tests/phpunit/tests/ajax/Compression.php b/tests/phpunit/tests/ajax/Compression.php index d8d5235644..475c206807 100644 --- a/tests/phpunit/tests/ajax/Compression.php +++ b/tests/phpunit/tests/ajax/Compression.php @@ -12,7 +12,6 @@ require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); * @subpackage UnitTests * @since 3.4.0 * @group ajax - * @runTestsInSeparateProcesses */ class Tests_Ajax_CompressionTest extends WP_Ajax_UnitTestCase { diff --git a/tests/phpunit/tests/ajax/CustomizeMenus.php b/tests/phpunit/tests/ajax/CustomizeMenus.php index 135929756c..eb0fb3b9dd 100644 --- a/tests/phpunit/tests/ajax/CustomizeMenus.php +++ b/tests/phpunit/tests/ajax/CustomizeMenus.php @@ -6,7 +6,6 @@ * @subpackage UnitTests * @since 4.3.0 * @group ajax - * @runTestsInSeparateProcesses */ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { diff --git a/tests/phpunit/tests/ajax/Response.php b/tests/phpunit/tests/ajax/Response.php index 9c48a8161d..bc99341fb0 100644 --- a/tests/phpunit/tests/ajax/Response.php +++ b/tests/phpunit/tests/ajax/Response.php @@ -6,7 +6,6 @@ * @subpackage UnitTests * @since 3.5.0 * @group ajax - * @runInSeparateProcess */ class Tests_Ajax_Response extends WP_UnitTestCase { @@ -65,6 +64,8 @@ class Tests_Ajax_Response extends WP_UnitTestCase { * Needs a separate process to get around the headers/output from the * bootstrapper * @ticket 19448 + * @runInSeparateProcess + * @preserveGlobalState disabled */ public function test_response_charset_in_header() {