public function ThemeInstallerTest::testInstallSubTheme in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallSubTheme()
- 10 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallSubTheme()
Tests installing a sub-theme.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Theme/ ThemeInstallerTest.php, line 84
Class
- ThemeInstallerTest
- Tests installing and uninstalling of themes.
Namespace
Drupal\KernelTests\Core\ThemeCode
public function testInstallSubTheme() {
$name = 'test_subtheme';
$base_name = 'test_basetheme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
$this
->themeInstaller()
->install([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertTrue(isset($themes[$name]));
$this
->assertTrue(isset($themes[$base_name]));
$this
->themeInstaller()
->uninstall([
$name,
]);
$themes = $this
->themeHandler()
->listInfo();
$this
->assertFalse(isset($themes[$name]));
$this
->assertTrue(isset($themes[$base_name]));
}