function CoreRecipesTest::providerApplyRecipe

The data provider for apply recipe test.

Return value

iterable<array<string>> An iterable containing paths to recipe files.

File

core/tests/Drupal/FunctionalTests/Core/Recipe/CoreRecipesTest.php, line 36

Class

CoreRecipesTest
Tests applying all core-provided recipes on top of the Empty profile.

Namespace

Drupal\FunctionalTests\Core\Recipe

Code

public static function providerApplyRecipe() : iterable {
    $finder = Finder::create()->in([
        static::getDrupalRoot() . '/core/recipes',
    ])
        ->directories()
        ->depth(0)
        ->notName([
        'example',
    ]);
    $scenarios = [];
    
    /** @var \Symfony\Component\Finder\SplFileInfo $recipe */
    foreach ($finder as $recipe) {
        $name = $recipe->getBasename();
        $scenarios[$name] = [
            $recipe->getPathname(),
        ];
    }
    return $scenarios;
}

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