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