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