You are here

public function ThemeInstallerTest::testInstallThemeWithUnmetModuleDependencies in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallThemeWithUnmetModuleDependencies()
  2. 10 core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php \Drupal\KernelTests\Core\Theme\ThemeInstallerTest::testInstallThemeWithUnmetModuleDependencies()

Tests installing a theme with unmet module dependencies.

@dataProvider providerTestInstallThemeWithUnmetModuleDependencies

File

core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php, line 147

Class

ThemeInstallerTest
Tests installing and uninstalling of themes.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function testInstallThemeWithUnmetModuleDependencies($theme_name, $installed_modules, $message) {
  $this->container
    ->get('module_installer')
    ->install($installed_modules);
  $themes = $this
    ->themeHandler()
    ->listInfo();
  $this
    ->assertEmpty($themes);
  $this
    ->expectException(MissingDependencyException::class);
  $this
    ->expectExceptionMessage($message);
  $this
    ->themeInstaller()
    ->install([
    $theme_name,
  ]);
}