From 9cdffaaed809c36f16dfcbd1a22953451e099d39 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 3 Oct 2015 18:35:58 +0000 Subject: [PATCH] Tests: Move the global permalinks reset routine to only fire when running core tests. Should fix intermittent mysqli response errors in the AJAX tests. See #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@34803 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/testcase.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/includes/testcase.php b/tests/phpunit/includes/testcase.php index ec4640f008..3200dd2c7b 100644 --- a/tests/phpunit/includes/testcase.php +++ b/tests/phpunit/includes/testcase.php @@ -42,6 +42,8 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $this->factory = new WP_UnitTest_Factory; $this->clean_up_global_scope(); + self::$default_permalink_structure = get_option( 'permalink_structure' ); + /* * When running core tests, ensure that post types and taxonomies * are reset for each test. We skip this step for non-core tests, @@ -52,6 +54,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { $this->reset_post_types(); $this->reset_taxonomies(); $this->reset_post_statuses(); + $this->reset_permalinks(); } $this->start_transaction(); @@ -72,10 +75,6 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase { if ( is_multisite() ) { add_filter( 'pre_option_db_version', array( $this, 'db_version' ) ); } - - self::$default_permalink_structure = get_option( 'permalink_structure' ); - - $this->reset_permalinks(); } /**