/** @test */ public function should_add_discount() { $this->product->discount(new PercentageDiscount(20)); $this->assertInstanceOf('PhilipBrown\\Basket\\Discounts\\PercentageDiscount', $this->product->discount); }
/** * Price: £32.99 * Rate: 20% * Quantity: 4 * Freebie: false * Taxable: true * Discount: 10% * Delivery: £6.99 * * @return Product */ public function seven() { $sku = '7'; $name = 'Kettlebell'; $rate = new UnitedKingdomValueAddedTax(); $price = new Money(3299, new Currency('GBP')); $product = new Product($sku, $name, $price, $rate); $product->quantity(4); $product->discount(new PercentageDiscount(10)); $product->delivery(new Money(699, new Currency('GBP'))); return $product; }