You are here

public function StableThemeTest::testStableIsDefault in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/StableThemeTest.php \Drupal\system\Tests\Theme\StableThemeTest::testStableIsDefault()

Ensures Stable is used by default when no base theme has been defined.

File

core/modules/system/src/Tests/Theme/StableThemeTest.php, line 53
Contains \Drupal\system\Tests\Theme\StableThemeTest.

Class

StableThemeTest
Tests the behavior of the Stable theme.

Namespace

Drupal\system\Tests\Theme

Code

public function testStableIsDefault() {
  $this->themeHandler
    ->install([
    'test_stable',
  ]);
  $this
    ->config('system.theme')
    ->set('default', 'test_stable')
    ->save();
  $theme = $this->themeManager
    ->getActiveTheme();

  /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */
  $base_themes = $theme
    ->getBaseThemes();
  $base_theme = reset($base_themes);
  $this
    ->assertTrue($base_theme
    ->getName() == 'stable', "Stable theme is the base theme if a theme hasn't decided to opt out.");
}