function RecipeRunnerTest::testModuleAndThemeInstall
Same name in other branches
- 10 core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php \Drupal\KernelTests\Core\Recipe\RecipeRunnerTest::testModuleAndThemeInstall()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Recipe/ RecipeRunnerTest.php, line 43
Class
- RecipeRunnerTest
- @coversDefaultClass \Drupal\Core\Recipe\RecipeRunner @group Recipe
Namespace
Drupal\KernelTests\Core\RecipeCode
public function testModuleAndThemeInstall() : void {
$recipe = Recipe::createFromDirectory('core/tests/fixtures/recipes/base_theme_and_views');
RecipeRunner::processRecipe($recipe);
// Test the state after applying the recipe.
$this->assertTrue($this->container
->get('module_handler')
->moduleExists('views'), 'The views module is installed');
$this->assertTrue($this->container
->get('module_handler')
->moduleExists('node'), 'The node module is installed');
$this->assertTrue($this->container
->get('theme_handler')
->themeExists('test_base_theme'), 'The test_base_theme theme is installed');
$this->assertTrue($this->container
->get('theme_handler')
->themeExists('test_subtheme'), 'The test_subtheme theme is installed');
$this->assertTrue($this->container
->get('theme_handler')
->themeExists('test_subsubtheme'), 'The test_subsubtheme theme is installed');
$this->assertTrue($this->container
->get('config.storage')
->exists('node.settings'), 'The node.settings configuration has been created');
$this->assertFalse($this->container
->get('config.storage')
->exists('views.view.archive'), 'The views.view.archive configuration has not been created');
$this->assertEmpty(View::loadMultiple(), "No views exist");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.