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

8.1.x
Nathaniel Catchpole 2015-12-29 23:07:23 +09:00
parent 92e7090454
commit 314de72dca
11 changed files with 15 additions and 15 deletions

View File

@ -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');

View File

@ -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();

View File

@ -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'));

View File

@ -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',

View File

@ -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('<front>', [], ['absolute' => TRUE]);

View File

@ -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());

View File

@ -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();

View File

@ -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');

View File

@ -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();

View File

@ -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');

View File

@ -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(