Commit cffc13a8 authored by alexpott's avatar alexpott

Issue #2498691 by cilefen, mesch, deepakaryan1988, RavindraSingh, honzakuchar,...

Issue #2498691 by cilefen, mesch, deepakaryan1988, RavindraSingh, honzakuchar, darol100, kattekrab, Cottser, David_Rothstein: "Install and set as default" link on the Appearance page doesn't work
parent f1463d37
......@@ -167,7 +167,7 @@ public function setDefault($name) {
public function install(array $theme_list, $install_dependencies = TRUE) {
// We keep the old install() method as BC layer but redirect directly to the
// theme installer.
\Drupal::service('theme_installer')->install($theme_list, $install_dependencies);
return \Drupal::service('theme_installer')->install($theme_list, $install_dependencies);
......@@ -334,4 +334,28 @@ function testUninstallingThemes() {
$this->assertRaw('The <em class="placeholder">Classy</em> theme has been uninstalled');
* Tests installing a theme and setting it as default.
function testInstallAndSetAsDefault() {
// Bartik is uninstalled in the test profile and has the second "Install and
// set as default" link.
$this->clickLink(t('Install and set as default'), 1);
// Test the confirmation message.
$this->assertText('Bartik is now the default theme.');
// Make sure Bartik is now set as the default theme in config.
$this->assertEqual($this->config('system.theme')->get('default'), 'bartik');
// This checks for a regression. See
$this->assertNoText('The bartik theme was not found.');
$themes = \Drupal::service('theme_handler')->rebuildThemeData();
$version = $themes['bartik']->info['version'];
// Confirm Bartik is indicated as the default theme.
$this->assertTextPattern('/Bartik ' . preg_quote($version) . '\s{2,}\(default theme\)/');
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