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() {
// 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');
......
......@@ -120,7 +120,7 @@ function testFieldItemListView() {
$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();
......
......@@ -66,7 +66,7 @@ protected function setUp() {
// 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'));
......
......@@ -33,7 +33,7 @@ public function testIntegerFormatter() {
*/
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 @@ public function testFloatFormatter() {
*/
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 @@ public function testFloatFormatterWithScale() {
*/
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 @@ public function testDecimalFormatter() {
*/
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',
......
......@@ -109,7 +109,7 @@ protected function setUp() {
// 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('<front>', [], ['absolute' => TRUE]);
......
......@@ -52,7 +52,7 @@ public function testCurrentTheme() {
$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());
......
......@@ -98,7 +98,7 @@ function testThemeTableWithEmptyMessage() {
// 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();
......
......@@ -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');
......
......@@ -52,7 +52,7 @@ public function setUp() {
*/
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 @@ public function testStableIsDefault() {
*/
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();
......
......@@ -31,7 +31,7 @@ function testTwigDebugMarkup() {
$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');
......
......@@ -54,7 +54,7 @@ protected function setUp() {
// 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(
......
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