Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /** @test */
 public function should_return_the_products_collection()
 {
     $this->assertInstanceOf('PhilipBrown\\Basket\\Collection', $this->basket->products());
 }