/** * @test */ public function getCouponTaxReturnsAllCouponsTaxSum() { $gross = 10.0; $tax = $gross - $gross / ($this->normalTaxClass->getCalc() + 1); $firstCoupon = $this->getMock(\Extcode\Cart\Domain\Model\Cart\CartCoupon::class, [], array(), '', false, true, true, array('getCode', 'getTax', 'getTaxClass', 'getIsUseable', 'getIsCombinable')); $firstCoupon->expects($this->any())->method('getCode')->will($this->returnValue('firstCouponCode')); $firstCoupon->expects($this->any())->method('getTax')->will($this->returnValue($tax)); $firstCoupon->expects($this->any())->method('getTaxClass')->will($this->returnValue($this->normalTaxClass)); $firstCoupon->expects($this->any())->method('getIsUseable')->will($this->returnValue(true)); $firstCoupon->expects($this->any())->method('getIsCombinable')->will($this->returnValue(true)); $this->grossCart->addCoupon($firstCoupon); $taxes = []; $taxes[$this->normalTaxClass->getId()] += $tax; $this->assertArraySubset($taxes, $this->grossCart->getCouponTaxes()); $this->netCart->addCoupon($firstCoupon); $this->assertArraySubset($taxes, $this->netCart->getCouponTaxes()); }