Beispiel #1
0
 public function getDiscountPrice(Item $item)
 {
     $discountPrice = $item->getProductPrice();
     if ($item->getAmount() > $this->amountMoreThan) {
         $discountPrice = $this->discountPrice;
     }
     return $discountPrice;
 }
Beispiel #2
0
 public function getDiscountAmount(Item $item)
 {
     $discountAmount = $item->getAmount() - floor($item->getAmount() / $this->ereryNdFree);
     return $discountAmount;
 }
Beispiel #3
0
 /**
  * @depends testCreateItem
  */
 public function testAddItem(Item $item)
 {
     $item->addAmount(2);
     $this->assertEquals(5, $item->getAmount());
 }