Beispiel #1
0
 /**
  *
  */
 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();
     }
 }
Beispiel #2
0
 /**
  * @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());
 }
Beispiel #3
0
 /**
  * @test
  */
 public function getTitleReturnsNameSetByConstructor()
 {
     $this->assertSame($this->title, $this->fixture->getTitle());
 }
Beispiel #4
0
 /**
  * @param float $tax
  * @param \Extcode\Cart\Domain\Model\Cart\TaxClass $taxClass
  *
  * @return void
  */
 public function subTax($tax, $taxClass)
 {
     $this->taxes[$taxClass->getId()] -= $tax;
 }
Beispiel #5
0
 /**
  * @test
  */
 public function getTaxInitiallyReturnsTaxSetIndirectlyByConstructor()
 {
     $tax = $this->discount - $this->discount / ($this->taxClass->getCalc() + 1);
     $this->assertSame($tax, $this->coupon->getTax());
 }