diff --git a/core/modules/ckeditor/src/Tests/CKEditorTest.php b/core/modules/ckeditor/src/Tests/CKEditorTest.php index 6722393e67a..4df01133331 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorTest.php @@ -266,7 +266,7 @@ class CKEditorTest extends KernelTestBase { // Enable the Bartik theme, which specifies a CKEditor stylesheet. \Drupal::service('theme_handler')->install(['bartik']); - $this->config('system.theme')->set('default', 'bartik')->save(); + \Drupal::service('theme_handler')->setDefault('bartik'); $expected[] = file_create_url('core/themes/bartik/css/base/elements.css'); $expected[] = file_create_url('core/themes/bartik/css/components/captions.css'); $expected[] = file_create_url('core/themes/bartik/css/components/table.css'); diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php index eff812b8112..0ad584dded5 100644 --- a/core/modules/field/src/Tests/DisplayApiTest.php +++ b/core/modules/field/src/Tests/DisplayApiTest.php @@ -120,7 +120,7 @@ class DisplayApiTest extends FieldUnitTestBase { $items = $this->entity->get($this->fieldName); \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); // No display settings: check that default display settings are used. $build = $items->view(); diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php index cc41f7da0f7..87da3ec1a59 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php @@ -66,7 +66,7 @@ class EntityReferenceFormatterTest extends EntityUnitTestBase { // Use Classy theme for testing markup output. \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); // Grant the 'view test entity' permission. $this->installConfig(array('user')); diff --git a/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php index 120d6f017fc..84248666eda 100644 --- a/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php +++ b/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php @@ -33,7 +33,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase { */ public function testIntegerFormatterWithSettings() { \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->fieldType = 'integer'; $formatter = array( 'type' => 'number_integer', @@ -76,7 +76,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase { */ public function testFloatFormatterWithSettings() { \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->fieldType = 'float'; $formatter = array( 'type' => 'number_decimal', @@ -126,7 +126,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase { */ public function testFloatFormatterWithScaleExercised() { \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->fieldType = 'float'; $formatter = array( 'type' => 'number_decimal', @@ -164,7 +164,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase { */ public function testDecimalFormatterWithSettings() { \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->fieldType = 'decimal'; $formatter = array( 'type' => 'number_decimal', diff --git a/core/modules/rdf/src/Tests/StandardProfileTest.php b/core/modules/rdf/src/Tests/StandardProfileTest.php index 57f4c3f6d4e..6ef3b53d312 100644 --- a/core/modules/rdf/src/Tests/StandardProfileTest.php +++ b/core/modules/rdf/src/Tests/StandardProfileTest.php @@ -109,7 +109,7 @@ class StandardProfileTest extends WebTestBase { // Use Classy theme for testing markup output. \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->baseUri = \Drupal::url('', [], ['absolute' => TRUE]); diff --git a/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php b/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php index 3139ecc2ca3..303f5838952 100644 --- a/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php +++ b/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php @@ -52,7 +52,7 @@ class CurrentThemeConditionTest extends KernelTestBase { $this->assertTrue($condition_negated->execute()); // Set the expected theme to be used. - $this->config('system.theme')->set('default', 'test_theme')->save(); + \Drupal::service('theme_handler')->setDefault('test_theme'); \Drupal::theme()->resetActiveTheme(); $this->assertTrue($condition->execute()); diff --git a/core/modules/system/src/Tests/Render/Element/TableTest.php b/core/modules/system/src/Tests/Render/Element/TableTest.php index 7d94cd916c2..7e909792ada 100644 --- a/core/modules/system/src/Tests/Render/Element/TableTest.php +++ b/core/modules/system/src/Tests/Render/Element/TableTest.php @@ -98,7 +98,7 @@ class TableTest extends KernelTestBase { // Enable the Classy theme. \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); $this->render($table); $this->removeWhiteSpace(); diff --git a/core/modules/system/src/Tests/Theme/MessageTest.php b/core/modules/system/src/Tests/Theme/MessageTest.php index db27d2a2f48..878d5bc3584 100644 --- a/core/modules/system/src/Tests/Theme/MessageTest.php +++ b/core/modules/system/src/Tests/Theme/MessageTest.php @@ -27,7 +27,7 @@ class MessageTest extends KernelTestBase { function testMessages() { // Enable the Classy theme. \Drupal::service('theme_handler')->install(['classy']); - $this->config('system.theme')->set('default', 'classy')->save(); + \Drupal::service('theme_handler')->setDefault('classy'); drupal_set_message('An error occurred', 'error'); drupal_set_message('But then something nice happened'); diff --git a/core/modules/system/src/Tests/Theme/StableThemeTest.php b/core/modules/system/src/Tests/Theme/StableThemeTest.php index 06866b5c410..8392029e8db 100644 --- a/core/modules/system/src/Tests/Theme/StableThemeTest.php +++ b/core/modules/system/src/Tests/Theme/StableThemeTest.php @@ -52,7 +52,7 @@ class StableThemeTest extends KernelTestBase { */ public function testStableIsDefault() { $this->themeHandler->install(['test_stable']); - $this->config('system.theme')->set('default', 'test_stable')->save(); + $this->themeHandler->setDefault('test_stable'); $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ $base_themes = $theme->getBaseThemes(); @@ -65,7 +65,7 @@ class StableThemeTest extends KernelTestBase { */ public function testWildWest() { $this->themeHandler->install(['test_wild_west']); - $this->config('system.theme')->set('default', 'test_wild_west')->save(); + $this->themeHandler->setDefault('test_wild_west'); $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ $base_themes = $theme->getBaseThemes(); diff --git a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php index 1b330d0d37f..c220dde30af 100644 --- a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php +++ b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php @@ -31,7 +31,7 @@ class TwigDebugMarkupTest extends WebTestBase { $renderer = $this->container->get('renderer'); $extension = twig_extension(); \Drupal::service('theme_handler')->install(array('test_theme')); - $this->config('system.theme')->set('default', 'test_theme')->save(); + \Drupal::service('theme_handler')->setDefault('test_theme'); $this->drupalCreateContentType(array('type' => 'page')); // Enable debug, rebuild the service container, and clear all caches. $parameters = $this->container->getParameter('twig.config'); diff --git a/core/modules/system/src/Tests/Theme/TwigTransTest.php b/core/modules/system/src/Tests/Theme/TwigTransTest.php index 867c4d5bae2..9eec24719bf 100644 --- a/core/modules/system/src/Tests/Theme/TwigTransTest.php +++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php @@ -54,7 +54,7 @@ class TwigTransTest extends WebTestBase { // Setup test_theme. \Drupal::service('theme_handler')->install(array('test_theme')); - $this->config('system.theme')->set('default', 'test_theme')->save(); + \Drupal::service('theme_handler')->setDefault('test_theme'); // Create and log in as admin. $this->adminUser = $this->drupalCreateUser(array(