/** @test */
 public function should_reconcile_product_fixture_one()
 {
     $product = $this->fixtures->one();
     $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(1500, 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(1500, new Currency('GBP')), $subtotal);
     $this->assertEquals(new Money(1500, new Currency('GBP')), $total);
 }
Exemplo n.º 2
0
 /**
  * Add Product One
  *
  * @param Basket $basket
  * @return Basket
  */
 private function addProductOne(Basket $basket)
 {
     $one = $this->products->one();
     $basket->add($one->sku, $one->name, $one->price, function ($product) use($one) {
         $product->category($one->category);
     });
     return $basket;
 }