function RecipeTest::testPreExistingMatchingConfiguration

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Recipe/RecipeTest.php \Drupal\KernelTests\Core\Recipe\RecipeTest::testPreExistingMatchingConfiguration()

File

core/tests/Drupal/KernelTests/Core/Recipe/RecipeTest.php, line 59

Class

RecipeTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Recipe%21Recipe.php/class/Recipe/11.x" title="@internal This API is experimental." class="local">\Drupal\Core\Recipe\Recipe</a> @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testPreExistingMatchingConfiguration() : void {
    // Install the node module, its dependencies and configuration.
    $this->container
        ->get('module_installer')
        ->install([
        'node',
    ]);
    // Change the config to match the recipe's config to prevent the exception
    // being thrown.
    $this->config('node.settings')
        ->set('use_admin_theme', TRUE)
        ->save();
    $recipe = Recipe::createFromDirectory('core/tests/fixtures/recipes/install_node_with_config');
    $this->assertSame('core/tests/fixtures/recipes/install_node_with_config/config', $recipe->config->recipeConfigDirectory);
}

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