/** * Add Product Seven * * @param Basket $basket * @return Basket */ private function addProductSeven(Basket $basket) { $seven = $this->products->seven(); $basket->add($seven->sku, $seven->name, $seven->price, function ($product) use($seven) { $product->quantity($seven->quantity); $product->discount($seven->discount); $product->delivery($seven->delivery); }); return $basket; }
/** @test */ public function should_reconcile_product_fixture_seven() { $product = $this->fixtures->seven(); $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(13196, new Currency('GBP')), $value); $this->assertEquals(new Money(1320, new Currency('GBP')), $discount); $this->assertEquals(new Money(2796, new Currency('GBP')), $delivery); $this->assertEquals(new Money(2375, new Currency('GBP')), $tax); $this->assertEquals(new Money(14672, new Currency('GBP')), $subtotal); $this->assertEquals(new Money(17047, new Currency('GBP')), $total); }