function RecipeTest::testCreateFromDirectoryNoRecipe

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

File

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

Class

RecipeTest
@coversDefaultClass \Drupal\Core\Recipe\Recipe @group Recipe

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testCreateFromDirectoryNoRecipe() : void {
    $dir = uniqid('public://');
    mkdir($dir);
    $this->expectException(RecipeFileException::class);
    $this->expectExceptionMessage('There is no ' . $dir . '/recipe.yml file');
    Recipe::createFromDirectory($dir);
}

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