App\Services\Deployment\DeployerRecipeFileBuilder::setRecipe PHP Method

setRecipe() public method

Set a recipe model instance.
public setRecipe ( Model $recipe ) : DeployerRecipeFileBuilder
$recipe Illuminate\Database\Eloquent\Model
return DeployerRecipeFileBuilder $this
    public function setRecipe(Model $recipe)
    {
        $this->recipe = $recipe;
        return $this;
    }

Usage Example

 public function test_Should_BuildDeployerRecipeFile()
 {
     $this->mockFilesystem->shouldReceive('delete')->once();
     $this->mockFilesystem->shouldReceive('put')->once();
     $recipeFileBuilder = new DeployerRecipeFileBuilder($this->mockFilesystem, new DeployerFile());
     $recipeFileBuilder->setRecipe($this->mockRecipeModel);
     $result = $recipeFileBuilder->pathInfo()->put()->getResult();
     $this->assertStringMatchesFormat('recipe_%x.php', $result->getBaseName());
     $this->assertStringMatchesFormat(storage_path("app/recipe_%x.php"), $result->getFullPath());
 }