public function addDiscount(DiscountItem $discount) { $productName = $discount->getDiscountProductName(); if (false === isset($this->discounts[$productName])) { $this->discounts[$productName] = array(); } $this->discounts[$productName][] = $discount; }
public function testGetProductName() { $discount = new DiscountItem(DiscountItem::DISCOUNT_TYPE_PRICE_ABOVE_QUANTITY, 'Apple', 5, 7); // 7 = 32 -25 $this->assertEquals('Apple', $discount->getDiscountProductName()); }