/** * Generate the Meta Data * * @param Basket $basket * @return mixed */ public function generate(Basket $basket) { $total = new Money(0, $basket->currency()); foreach ($basket->products() as $product) { $total = $total->add($this->reconciler->value($product)); } return $total; }
/** * Generate the Meta Data * * @param Basket $basket * @return mixed */ public function generate(Basket $basket) { $total = 0; foreach ($basket->products() as $product) { $total = $total + $product->quantity; } return $total; }
/** @test */ public function should_return_the_products_collection() { $this->assertInstanceOf('PhilipBrown\\Basket\\Collection', $this->basket->products()); }