/** * Add Product Five * * @param Basket $basket * @return Basket */ private function addProductFive(Basket $basket) { $five = $this->products->five(); $basket->add($five->sku, $five->name, $five->price, function ($product) use($five) { $product->discount($five->discount); }); return $basket; }
/** @test */ public function should_reconcile_product_fixture_five() { $product = $this->fixtures->five(); $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(4950, new Currency('GBP')), $value); $this->assertEquals(new Money(1500, new Currency('GBP')), $discount); $this->assertEquals(new Money(0, new Currency('GBP')), $delivery); $this->assertEquals(new Money(690, new Currency('GBP')), $tax); $this->assertEquals(new Money(3450, new Currency('GBP')), $subtotal); $this->assertEquals(new Money(4140, new Currency('GBP')), $total); }