/** @test */
 public function should_reconcile_product_fixture_three()
 {
     $product = $this->fixtures->three();
     $value = $this->reconciler->value($product);
     $discount = $this->reconciler->discount($product);
     $delivery = $this->reconciler->delivery($product);
     $tax = $this->reconciler->tax($product);
     $subtotal = $this->reconciler->subtotal($product);
     $total = $this->reconciler->total($product);
     $this->assertEquals(new Money(499, new Currency('GBP')), $value);
     $this->assertEquals(new Money(0, new Currency('GBP')), $discount);
     $this->assertEquals(new Money(0, new Currency('GBP')), $delivery);
     $this->assertEquals(new Money(0, new Currency('GBP')), $tax);
     $this->assertEquals(new Money(0, new Currency('GBP')), $subtotal);
     $this->assertEquals(new Money(0, new Currency('GBP')), $total);
 }
Пример #2
0
 /**
  * Add Product Three
  *
  * @param Basket $basket
  * @return Basket
  */
 private function addProductThree(Basket $basket)
 {
     $three = $this->products->three();
     $basket->add($three->sku, $three->name, $three->price, function ($product) use($three) {
         $product->freebie($three->freebie);
     });
     return $basket;
 }