BaseThemeRequiredTest.php in Drupal 8
File
core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php
View source
<?php
namespace Drupal\KernelTests\Core\Theme;
use Drupal\KernelTests\KernelTestBase;
class BaseThemeRequiredTest extends KernelTestBase {
public static $modules = [
'system',
];
protected $themeInstaller;
protected $themeManager;
protected function setUp() {
parent::setUp();
$this->themeInstaller = $this->container
->get('theme_installer');
$this->themeManager = $this->container
->get('theme.manager');
}
public function testWildWest() {
$this->themeInstaller
->install([
'test_wild_west',
]);
$this
->config('system.theme')
->set('default', 'test_wild_west')
->save();
$theme = $this->themeManager
->getActiveTheme();
$base_themes = $theme
->getBaseThemeExtensions();
$this
->assertTrue(empty($base_themes), 'No base theme is set when a theme has opted out of using Stable.');
}
}