Beispiel #1
0
 public function put(Ingredient $ingredient)
 {
     if (!$ingredient->hasExpired()) {
         $this->items[] = $ingredient;
     }
 }
Beispiel #2
0
 public function testIngredientWhenExpired()
 {
     $ingredient = new Ingredient('butter', 1, 'slices', new DateTime('-30 day'));
     $this->assertEquals($ingredient->hasExpired(), true);
 }