/** * Add Product Six * * @param Basket $basket * @return Basket */ private function addProductSix(Basket $basket) { $six = $this->products->six(); $basket->add($six->sku, $six->name, $six->price, function ($product) use($six) { $product->delivery($six->delivery); }); return $basket; }
/** @test */ public function should_reconcile_product_fixture_six() { $product = $this->fixtures->six(); $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(89999, new Currency('GBP')), $value); $this->assertEquals(new Money(0, new Currency('GBP')), $discount); $this->assertEquals(new Money(6000, new Currency('GBP')), $delivery); $this->assertEquals(new Money(18000, new Currency('GBP')), $tax); $this->assertEquals(new Money(95999, new Currency('GBP')), $subtotal); $this->assertEquals(new Money(113999, new Currency('GBP')), $total); }