diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index 97b1d68..d6bd64f 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -11,7 +11,6 @@ use Drupal\Core\DrupalKernel; use Drupal\Core\KeyValueStore\KeyValueMemoryFactory; use Drupal\Core\Language\Language; -use Drupal\Core\Site\Settings; use Symfony\Component\DependencyInjection\Reference; use Drupal\Core\Database\Database; use Symfony\Component\HttpFoundation\Request; @@ -466,18 +465,4 @@ protected function unregisterStreamWrapper($scheme, $type) { } } - /** - * Changes in-memory settings. - * - * @param string $name - * The name of the setting to set. - * @param mixed $value - * The value of the setting. - */ - protected function settingsSet($name, $value) { - $settings = Settings::getAll(); - $settings[$name] = $value; - new Settings($settings); - } - } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php index 9d93fa0..1ed9c46 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php @@ -9,6 +9,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\Database\ConnectionNotDefinedException; +use Drupal\Core\Site\Settings; /** * Base test case class for unit tests. @@ -40,4 +41,19 @@ protected function setUp() { file_prepare_directory($this->public_files_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); $this->settingsSet('file_public_path', $this->public_files_directory); } + + /** + * Changes in-memory settings. + * + * @param string $name + * The name of the setting to set. + * @param mixed $value + * The value of the setting. + */ + protected function settingsSet($name, $value) { + $settings = Settings::getAll(); + $settings[$name] = $value; + new Settings($settings); + } + }