diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 738b573..bca0239 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -921,7 +921,7 @@ protected function beforePrepareEnvironment() { * @see TestBase::beforePrepareEnvironment() */ private function prepareEnvironment() { - global $user; + global $user, $conf; // Allow (base) test classes to backup global state information. $this->beforePrepareEnvironment(); @@ -940,6 +940,7 @@ private function prepareEnvironment() { // Backup current in-memory configuration. $this->originalSettings = settings()->getAll(); + $this->originalConf = $conf; // Backup statics and globals. $this->originalContainer = clone \Drupal::getContainer(); @@ -1035,6 +1036,9 @@ private function prepareEnvironment() { // Change the database prefix. $this->changeDatabasePrefix(); + // Reset all variables to perform tests in a clean environment. + $conf = array(); + drupal_set_time_limit($this->timeLimit); } @@ -1112,7 +1116,7 @@ protected function tearDown() { * @see TestBase::prepareEnvironment() */ private function restoreEnvironment() { - global $user; + global $user, $conf; // Reset all static variables. // Unsetting static variables will potentially invoke destruct methods, @@ -1173,6 +1177,7 @@ private function restoreEnvironment() { drupal_static_reset(); // Restore original in-memory configuration. + $conf = $this->originalConf; new Settings($this->originalSettings); // Restore original statics and globals.