reverted: --- b/core/modules/simpletest/src/TestBase.php +++ a/core/modules/simpletest/src/TestBase.php @@ -11,7 +11,6 @@ use Drupal\Component\Utility\Random; use Drupal\Core\Database\Database; use Drupal\Component\Utility\String; -use Drupal\Core\DrupalKernel; use Drupal\Core\Config\ConfigImporter; use Drupal\Core\Config\StorageComparer; use Drupal\Core\DependencyInjection\ContainerBuilder; @@ -1120,9 +1119,7 @@ } // Backup current in-memory configuration. + $this->originalSite = conf_path(); - $request = Request::createFromGlobals(); - $conf_path = DrupalKernel::findSitePath($request); - $this->originalSite = $conf_path; $this->originalSettings = Settings::getAll(); $this->originalConfig = $GLOBALS['config']; // @todo Remove all remnants of $GLOBALS['conf']. @@ -1137,7 +1134,7 @@ // Save further contextual information. // Use the original files directory to avoid nesting it within an existing // simpletest directory if a test is executed within a test. + $this->originalFileDirectory = Settings::get('file_public_path', conf_path() . '/files'); - $this->originalFileDirectory = Settings::get('file_public_path', $conf_path . '/files'); $this->originalProfile = drupal_get_profile(); $this->originalUser = isset($user) ? clone $user : NULL; @@ -1207,7 +1204,7 @@ // After preparing the environment and changing the database prefix, we are // in a valid test environment. drupal_valid_test_ua($this->databasePrefix); + conf_path(FALSE, TRUE); - DrupalKernel::findSitePath($request); // Reset settings. new Settings(array( @@ -1321,7 +1318,7 @@ else { drupal_valid_test_ua(FALSE); } + conf_path(TRUE, TRUE); - DrupalKernel::findSitePath($request); // Restore original shutdown callbacks. $callbacks = &drupal_register_shutdown_function(); only in patch2: unchanged: --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -5,9 +5,11 @@ * Install, update, and uninstall functions for the Locale module. */ +use Drupal\Core\DrupalKernel; use Drupal\Core\Url; use Drupal\Core\Language\Language; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected; +use Symfony\Component\HttpFoundation\Request; /** * Implements hook_install(). @@ -15,7 +17,9 @@ function locale_install() { // Create the interface translations directory and ensure it's writable. if (!$directory = \Drupal::config('locale.settings')->get('translation.path')) { - $directory = conf_path() . '/files/translations'; + $request = Request::createFromGlobals(); + $conf_path = DrupalKernel::findSitePath($request); + $directory = $conf_path . '/files/translations'; \Drupal::configFactory()->getEditable('locale.settings')->set('translation.path', $directory)->save(); } file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);