function RecipeRunnerTest::testThemeModuleDependenciesInstall

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php \Drupal\KernelTests\Core\Recipe\RecipeRunnerTest::testThemeModuleDependenciesInstall()
  2. 10 core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php \Drupal\KernelTests\Core\Recipe\RecipeRunnerTest::testThemeModuleDependenciesInstall()

Tests module and theme dependencies installed after processing a recipe.

File

core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php, line 73

Class

RecipeRunnerTest
Tests Drupal\Core\Recipe\RecipeRunner.

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testThemeModuleDependenciesInstall() : void {
  $recipe = Recipe::createFromDirectory('core/tests/fixtures/recipes/theme_with_module_dependencies');
  RecipeRunner::processRecipe($recipe);
  // Test the state after applying the recipe.
  $this->assertTrue($this->container
    ->get('module_handler')
    ->moduleExists('test_module_required_by_theme'), 'The test_module_required_by_theme module is installed');
  $this->assertTrue($this->container
    ->get('module_handler')
    ->moduleExists('test_another_module_required_by_theme'), 'The test_another_module_required_by_theme module is installed');
  $this->assertTrue($this->container
    ->get('theme_handler')
    ->themeExists('test_theme_depending_on_modules'), 'The test_theme_depending_on_modules theme is installed');
}

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