Commit 314de72d authored by catch's avatar catch

Issue #2635784 by cilefen: setDefault() on ThemeHandler is not used in all the places it could

parent 92e70904
...@@ -266,7 +266,7 @@ function testBuildContentsCssJSSetting() { ...@@ -266,7 +266,7 @@ function testBuildContentsCssJSSetting() {
// Enable the Bartik theme, which specifies a CKEditor stylesheet. // Enable the Bartik theme, which specifies a CKEditor stylesheet.
\Drupal::service('theme_handler')->install(['bartik']); \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/base/elements.css');
$expected[] = file_create_url('core/themes/bartik/css/components/captions.css'); $expected[] = file_create_url('core/themes/bartik/css/components/captions.css');
$expected[] = file_create_url('core/themes/bartik/css/components/table.css'); $expected[] = file_create_url('core/themes/bartik/css/components/table.css');
......
...@@ -120,7 +120,7 @@ function testFieldItemListView() { ...@@ -120,7 +120,7 @@ function testFieldItemListView() {
$items = $this->entity->get($this->fieldName); $items = $this->entity->get($this->fieldName);
\Drupal::service('theme_handler')->install(['classy']); \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. // No display settings: check that default display settings are used.
$build = $items->view(); $build = $items->view();
......
...@@ -66,7 +66,7 @@ protected function setUp() { ...@@ -66,7 +66,7 @@ protected function setUp() {
// Use Classy theme for testing markup output. // Use Classy theme for testing markup output.
\Drupal::service('theme_handler')->install(['classy']); \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. // Grant the 'view test entity' permission.
$this->installConfig(array('user')); $this->installConfig(array('user'));
......
...@@ -33,7 +33,7 @@ public function testIntegerFormatter() { ...@@ -33,7 +33,7 @@ public function testIntegerFormatter() {
*/ */
public function testIntegerFormatterWithSettings() { public function testIntegerFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->fieldType = 'integer'; $this->fieldType = 'integer';
$formatter = array( $formatter = array(
'type' => 'number_integer', 'type' => 'number_integer',
...@@ -76,7 +76,7 @@ public function testFloatFormatter() { ...@@ -76,7 +76,7 @@ public function testFloatFormatter() {
*/ */
public function testFloatFormatterWithSettings() { public function testFloatFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->fieldType = 'float'; $this->fieldType = 'float';
$formatter = array( $formatter = array(
'type' => 'number_decimal', 'type' => 'number_decimal',
...@@ -126,7 +126,7 @@ public function testFloatFormatterWithScale() { ...@@ -126,7 +126,7 @@ public function testFloatFormatterWithScale() {
*/ */
public function testFloatFormatterWithScaleExercised() { public function testFloatFormatterWithScaleExercised() {
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->fieldType = 'float'; $this->fieldType = 'float';
$formatter = array( $formatter = array(
'type' => 'number_decimal', 'type' => 'number_decimal',
...@@ -164,7 +164,7 @@ public function testDecimalFormatter() { ...@@ -164,7 +164,7 @@ public function testDecimalFormatter() {
*/ */
public function testDecimalFormatterWithSettings() { public function testDecimalFormatterWithSettings() {
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->fieldType = 'decimal'; $this->fieldType = 'decimal';
$formatter = array( $formatter = array(
'type' => 'number_decimal', 'type' => 'number_decimal',
......
...@@ -109,7 +109,7 @@ protected function setUp() { ...@@ -109,7 +109,7 @@ protected function setUp() {
// Use Classy theme for testing markup output. // Use Classy theme for testing markup output.
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->baseUri = \Drupal::url('<front>', [], ['absolute' => TRUE]); $this->baseUri = \Drupal::url('<front>', [], ['absolute' => TRUE]);
......
...@@ -52,7 +52,7 @@ public function testCurrentTheme() { ...@@ -52,7 +52,7 @@ public function testCurrentTheme() {
$this->assertTrue($condition_negated->execute()); $this->assertTrue($condition_negated->execute());
// Set the expected theme to be used. // 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(); \Drupal::theme()->resetActiveTheme();
$this->assertTrue($condition->execute()); $this->assertTrue($condition->execute());
......
...@@ -98,7 +98,7 @@ function testThemeTableWithEmptyMessage() { ...@@ -98,7 +98,7 @@ function testThemeTableWithEmptyMessage() {
// Enable the Classy theme. // Enable the Classy theme.
\Drupal::service('theme_handler')->install(['classy']); \Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save(); \Drupal::service('theme_handler')->setDefault('classy');
$this->render($table); $this->render($table);
$this->removeWhiteSpace(); $this->removeWhiteSpace();
......
...@@ -27,7 +27,7 @@ class MessageTest extends KernelTestBase { ...@@ -27,7 +27,7 @@ class MessageTest extends KernelTestBase {
function testMessages() { function testMessages() {
// Enable the Classy theme. // Enable the Classy theme.
\Drupal::service('theme_handler')->install(['classy']); \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('An error occurred', 'error');
drupal_set_message('But then something nice happened'); drupal_set_message('But then something nice happened');
......
...@@ -52,7 +52,7 @@ public function setUp() { ...@@ -52,7 +52,7 @@ public function setUp() {
*/ */
public function testStableIsDefault() { public function testStableIsDefault() {
$this->themeHandler->install(['test_stable']); $this->themeHandler->install(['test_stable']);
$this->config('system.theme')->set('default', 'test_stable')->save(); $this->themeHandler->setDefault('test_stable');
$theme = $this->themeManager->getActiveTheme(); $theme = $this->themeManager->getActiveTheme();
/** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */
$base_themes = $theme->getBaseThemes(); $base_themes = $theme->getBaseThemes();
...@@ -65,7 +65,7 @@ public function testStableIsDefault() { ...@@ -65,7 +65,7 @@ public function testStableIsDefault() {
*/ */
public function testWildWest() { public function testWildWest() {
$this->themeHandler->install(['test_wild_west']); $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(); $theme = $this->themeManager->getActiveTheme();
/** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */
$base_themes = $theme->getBaseThemes(); $base_themes = $theme->getBaseThemes();
......
...@@ -31,7 +31,7 @@ function testTwigDebugMarkup() { ...@@ -31,7 +31,7 @@ function testTwigDebugMarkup() {
$renderer = $this->container->get('renderer'); $renderer = $this->container->get('renderer');
$extension = twig_extension(); $extension = twig_extension();
\Drupal::service('theme_handler')->install(array('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');
$this->drupalCreateContentType(array('type' => 'page')); $this->drupalCreateContentType(array('type' => 'page'));
// Enable debug, rebuild the service container, and clear all caches. // Enable debug, rebuild the service container, and clear all caches.
$parameters = $this->container->getParameter('twig.config'); $parameters = $this->container->getParameter('twig.config');
......
...@@ -54,7 +54,7 @@ protected function setUp() { ...@@ -54,7 +54,7 @@ protected function setUp() {
// Setup test_theme. // Setup test_theme.
\Drupal::service('theme_handler')->install(array('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. // Create and log in as admin.
$this->adminUser = $this->drupalCreateUser(array( $this->adminUser = $this->drupalCreateUser(array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment