public function ThemeInstallerTest::testInstallNonExisting in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallNonExisting()
- 10 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallNonExisting()
Tests installing a non-existing theme.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Theme/ ThemeInstallerTest.php, line 107
Class
- ThemeInstallerTest
- Tests installing and uninstalling of themes.
Namespace
Drupal\KernelTests\Core\ThemeCode
public function testInstallNonExisting() {
$name = 'non_existing_theme';
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
try {
$message = 'ThemeInstaller::install() throws UnknownExtensionException upon installing a non-existing theme.';
$this
->themeInstaller()
->install([
$name,
]);
$this
->fail($message);
} catch (\Exception $e) {
$this
->assertInstanceOf(UnknownExtensionException::class, $e);
}
$themes = $this
->themeHandler()
->listInfo();
$this
->assertEmpty(array_keys($themes));
}