function RecipeRunnerTest::testModuleAndThemeInstall

File

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

Class

RecipeRunnerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Recipe%21RecipeRunner.php/class/RecipeRunner/11.x" title="Applies a recipe." class="local">\Drupal\Core\Recipe\RecipeRunner</a> @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

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_basetheme'), 'The test_basetheme 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.