示例#1
0
文件: CartTest.php 项目: extcode/cart
 /**
  * @test
  */
 public function getCouponGrossReturnsCouponsGrossSumOfCouponsWhenCartMinPriceWasReached()
 {
     $this->addFirstProductToCarts();
     $discount = 5.0;
     $cartMinPrice = 15.0;
     $firstCoupon = $this->getMock(\Extcode\Cart\Domain\Model\Cart\CartCoupon::class, array(), array(), '', false);
     $firstCoupon->expects($this->any())->method('getCode')->will($this->returnValue('firstCouponCode'));
     $firstCoupon->expects($this->any())->method('getTitle')->will($this->returnValue('firstCouponTitle'));
     $firstCoupon->expects($this->any())->method('getDiscount')->will($this->returnValue($discount));
     $firstCoupon->expects($this->any())->method('getCartMinPrice')->will($this->returnValue($cartMinPrice));
     $firstCoupon->expects($this->any())->method('getTaxClass')->will($this->returnValue($this->normalTaxClass));
     $this->grossCart->addCoupon($firstCoupon);
     $this->assertSame(0.0, $this->grossCart->getCouponGross());
     $this->netCart->addCoupon($firstCoupon);
     $this->assertSame(0.0, $this->netCart->getCouponGross());
 }