/** @test */
 public function should_reconcile_product_fixture_zero()
 {
     $product = $this->fixtures->zero();
     $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(1000, 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(200, new Currency('GBP')), $tax);
     $this->assertEquals(new Money(1000, new Currency('GBP')), $subtotal);
     $this->assertEquals(new Money(1200, new Currency('GBP')), $total);
 }
Пример #2
0
 /**
  * Add Product Zero
  *
  * @param Basket $basket
  * @return Basket
  */
 private function addProductZero(Basket $basket)
 {
     $zero = $this->products->zero();
     $basket->add($zero->sku, $zero->name, $zero->price);
     return $basket;
 }