function CoreRecipesTest::providerRecipeHasGenericTest

Data provider for ::testRecipeHasGenericTest().

Return value

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

File

core/tests/Drupal/Tests/Core/Recipe/CoreRecipesTest.php, line 23

Class

CoreRecipesTest
Tests that all core recipes have a generic test.

Namespace

Drupal\Tests\Core\Recipe

Code

public static function providerRecipeHasGenericTest() : iterable {
    $finder = Finder::create()->in([
        dirname(__DIR__, 5) . '/recipes',
    ])
        ->directories()
        ->depth(0)
        ->notName([
        'example',
    ]);
    static::assertGreaterThan(0, count($finder), 'No core recipes were found.');
    $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.