diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php index 3d0741b..7e509a8 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php @@ -728,7 +728,7 @@ public function testTextFormatTranslation() { // security vulnerabilities. $config_factory ->setOverrideState(FALSE) - ->get('config_translation_test.content') + ->getEditable('config_translation_test.content') ->set('content.format', 'full_html') ->save(); diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php index 37d4d78..4ca566b 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateBase.php +++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php @@ -53,7 +53,7 @@ protected function setUp() { // Update module should not go out to d.o to check for updates. We override // the url to the default update_test xml path. But without providing // a mock xml file, no update data will be found. - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); + $this->config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); // Setup timestamps to identify old and new translation sources. $this->timestampOld = REQUEST_TIME - 300; @@ -63,7 +63,7 @@ protected function setUp() { // Enable import of translations. By default this is disabled for automated // tests. - \Drupal::config('locale.settings') + $this->config('locale.settings') ->set('translation.import_enabled', TRUE) ->save(); } @@ -77,7 +77,7 @@ protected function setUp() { */ protected function setTranslationsDirectory($path) { file_prepare_directory($path, FILE_CREATE_DIRECTORY); - \Drupal::config('locale.settings')->set('translation.path', $path)->save(); + $this->config('locale.settings')->set('translation.path', $path)->save(); } /** @@ -173,7 +173,7 @@ protected function makePoFile($path, $filename, $timestamp = NULL, array $transl * imported. */ protected function setTranslationFiles() { - $config = \Drupal::config('locale.settings'); + $config = $this->config('locale.settings'); // A flag is set to let the locale_test module replace the project data with // a set of test projects which match the below project files. diff --git a/core/modules/simpletest/src/InstallerTestBase.php b/core/modules/simpletest/src/InstallerTestBase.php index 09a71cb..339d3b1 100644 --- a/core/modules/simpletest/src/InstallerTestBase.php +++ b/core/modules/simpletest/src/InstallerTestBase.php @@ -160,7 +160,7 @@ protected function setUp() { // Manually configure the test mail collector implementation to prevent // tests from sending out e-mails and collect them in state instead. - $config->get('system.mail') + $config->getEditable('system.mail') ->set('interface.default', 'test_mail_collector') ->save(); diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index 84c1f42..99dfa76 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -480,7 +480,7 @@ protected function disableModules(array $modules) { // Unset the list of modules in the extension handler. $module_handler = $this->container->get('module_handler'); $module_filenames = $module_handler->getModuleList(); - $extension_config = $this->container->get('config.factory')->get('core.extension', TRUE); + $extension_config = $this->config('core.extension'); foreach ($modules as $module) { unset($module_filenames[$module]); $extension_config->clear('module.' . $module); diff --git a/core/modules/system/tests/modules/form_test/form_test.services.yml b/core/modules/system/tests/modules/form_test/form_test.services.yml index 472e0bc..24513a6 100644 --- a/core/modules/system/tests/modules/form_test/form_test.services.yml +++ b/core/modules/system/tests/modules/form_test/form_test.services.yml @@ -1,6 +1,7 @@ services: form_test.form.serviceform: class: Drupal\form_test\FormTestServiceObject + arguments: ['@config.factory'] form_test.event_subscriber: class: Drupal\form_test\EventSubscriber\FormTestEventSubscriber tags: