public function setUp() { $this->list = new DiscountList(); $this->discountFactory = new DiscountFactory(); $this->productFactory = new ProductFactory(); $this->discount = $this->discountFactory->createQuantityDiscountAboveQuantity('Apple', 5, 7); }
public function setUp() { $discountFactory = new DiscountFactory(); $discountList = new DiscountList(); $discountList->addDiscount($discountFactory->createPriceDiscountAboveQuantity('Apple', 5, 7)); $discountList->addDiscount($discountFactory->createQuantityDiscountAboveQuantity('Starship', 2, 1)); $this->cart = new Cart(); $this->cashier = new Cashier($discountList); $this->factory = new ProductFactory(); }