/** * Add Product Eight * * @param Basket $basket * @return Basket */ private function addProductEight(Basket $basket) { $eight = $this->products->eight(); $basket->add($eight->sku, $eight->name, $eight->price, function ($product) use($eight) { $product->quantity($eight->quantity); $product->taxable($eight->taxable); $product->delivery($eight->delivery); }); return $basket; }
/** @test */ public function should_reconcile_product_fixture_eight() { $product = $this->fixtures->eight(); $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(7998, new Currency('GBP')), $value); $this->assertEquals(new Money(0, new Currency('GBP')), $discount); $this->assertEquals(new Money(1198, new Currency('GBP')), $delivery); $this->assertEquals(new Money(0, new Currency('GBP')), $tax); $this->assertEquals(new Money(9196, new Currency('GBP')), $subtotal); $this->assertEquals(new Money(9196, new Currency('GBP')), $total); }