/** * */ private function calcTax() { if ($this->isNetPrice == false) { $this->tax = $this->gross / (1 + $this->taxClass->getCalc()) * $this->taxClass->getCalc(); } else { $this->tax = $this->net * $this->taxClass->getCalc(); } }
/** * @test */ public function getSubtotalNetReturnsSubtotalNet() { $price = 100.0; $couponGross = 10.0; $couponNet = $couponGross / 1.19; $cart = $this->getMock('Extcode\\Cart\\Domain\\Model\\Cart\\Cart', array('getCouponNet'), array(), '', false); $cart->expects($this->any())->method('getCouponNet')->will($this->returnValue($couponNet)); $product = new \Extcode\Cart\Domain\Model\Cart\Product('simple', 1, 0, 0, 1, 'First Product', $price, $this->normalTaxClass, 1, false); $cart->addProduct($product); $subtotalNet = $price / (1 + $this->normalTaxClass->getCalc()) - $couponNet; $this->assertSame($subtotalNet, $cart->getSubtotalNet()); }
/** * @test */ public function getCalcReturnsCalcSetByConstructor() { $this->assertSame($this->calc, $this->fixture->getCalc()); }
/** * @test */ public function getTaxInitiallyReturnsTaxSetIndirectlyByConstructor() { $tax = $this->discount - $this->discount / ($this->taxClass->getCalc() + 1); $this->assertSame($tax, $this->coupon->getTax()); }