Example #1
0
 public function test_Should_UpdateExistingRecipe()
 {
     $arrangedRecipe = Factory::create('App\\Models\\Recipe', ['name' => 'Recipe 1', 'description' => '', 'body' => '']);
     $recipeRepository = new EloquentRecipe(new App\Models\Recipe());
     $recipeRepository->update(['id' => $arrangedRecipe->id, 'name' => 'Recipe 2', 'description' => 'Description', 'body' => '<?php $x = 1;']);
     $recipe = new App\Models\Recipe();
     $updatedRecipe = $recipe->find($arrangedRecipe->id);
     $this->assertEquals('Recipe 2', $updatedRecipe->name);
     $this->assertEquals('Description', $updatedRecipe->description);
     $this->assertEquals('<?php $x = 1;', $updatedRecipe->body);
 }