function ConfigConfiguratorTest::testExistingConfigIsIgnoredInLenientMode

@testWith [false] [[]]

File

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

Class

ConfigConfiguratorTest
@covers \Drupal\Core\Recipe\ConfigConfigurator @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testExistingConfigIsIgnoredInLenientMode(array|false $strict_value) : void {
    $recipe = Recipe::createFromDirectory('core/recipes/page_content_type');
    $this->assertNotEmpty($recipe->config
        ->getConfigStorage()
        ->listAll());
    RecipeRunner::processRecipe($recipe);
    // Clone the recipe into the virtual file system, and opt the clone into
    // lenient mode.
    $recipe_dir = $this->cloneRecipe($recipe->path);
    $this->alterRecipe($recipe_dir, function (array $data) use ($strict_value) : array {
        $data['config']['strict'] = $strict_value;
        return $data;
    });
    // The recipe should not have any config to install; all of it already
    // exists.
    $recipe = Recipe::createFromDirectory($recipe_dir);
    $this->assertEmpty($recipe->config
        ->getConfigStorage()
        ->listAll());
}

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