示例#1
0
文件: CartTest.php 项目: extcode/cart
 /**
  * @test
  */
 public function getCouponNetReturnsAllCouponsNetSum()
 {
     $discount = 10.0;
     $net = $discount / ($this->normalTaxClass->getCalc() + 1);
     $firstCoupon = $this->getMock(\Extcode\Cart\Domain\Model\Cart\CartCoupon::class, array(), array(), '', false, true, true, array('getCode', 'getNet', 'getIsUseable', 'getIsCombinable'));
     $firstCoupon->expects($this->any())->method('getCode')->will($this->returnValue('firstCouponCode'));
     $firstCoupon->expects($this->any())->method('getNet')->will($this->returnValue($net));
     $firstCoupon->expects($this->any())->method('getIsUseable')->will($this->returnValue(true));
     $firstCoupon->expects($this->any())->method('getIsCombinable')->will($this->returnValue(true));
     $this->grossCart->addCoupon($firstCoupon);
     $this->assertSame($net, $this->grossCart->getCouponNet());
     $this->netCart->addCoupon($firstCoupon);
     $this->assertSame($net, $this->netCart->getCouponNet());
 }