function RecipeRunnerTest::testConfigWildcard

Same name in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Recipe/RecipeRunnerTest.php \Drupal\KernelTests\Core\Recipe\RecipeRunnerTest::testConfigWildcard()

File

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

Class

RecipeRunnerTest
@coversDefaultClass \Drupal\Core\Recipe\RecipeRunner @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testConfigWildcard() : void {
    // Test the state prior to applying the recipe.
    $this->assertEmpty($this->container
        ->get('config.factory')
        ->listAll('config_test.'), 'There is no config_test configuration');
    $recipe = Recipe::createFromDirectory('core/tests/fixtures/recipes/config_wildcard');
    RecipeRunner::processRecipe($recipe);
    // Test the state after to applying the recipe.
    $this->assertNotEmpty($this->container
        ->get('config.factory')
        ->listAll('config_test.'), 'There is config_test configuration');
    $config_test_entities = \Drupal::entityTypeManager()->getStorage('config_test')
        ->loadMultiple();
    $this->assertSame([
        'dotted.default',
        'override',
        'override_unmet',
    ], array_keys($config_test_entities));
    $this->assertSame('Default', $config_test_entities['dotted.default']->label());
    $this->assertSame('herp', $this->config('config_test.system')
        ->get('404'));
}

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