示例#1
0
文件: Fridge.php 项目: y2khjh/test1
 public function put(Ingredient $ingredient)
 {
     if (!$ingredient->hasExpired()) {
         $this->items[] = $ingredient;
     }
 }
示例#2
0
 public function testIngredientWhenExpired()
 {
     $ingredient = new Ingredient('butter', 1, 'slices', new DateTime('-30 day'));
     $this->assertEquals($ingredient->hasExpired(), true);
 }