function ThemeInstallerTest::testInstallThemeWithUnmetModuleDependencies

Same name 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()
  3. 11.x 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,
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.