fix test suite
This commit is contained in:
@@ -125,6 +125,12 @@ class BaseFacade implements FacadeInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCartTotalTaxPrice()
|
||||||
|
{
|
||||||
|
$taxCountry = $this->getContainer()->get('thelia.taxEngine')->getDeliveryCountry();
|
||||||
|
return $this->getCart()->getTaxedAmount($taxCountry);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the Checkout currency EUR|USD
|
* Return the Checkout currency EUR|USD
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -83,6 +83,13 @@ interface FacadeInterface
|
|||||||
*/
|
*/
|
||||||
public function getCartTotalPrice();
|
public function getCartTotalPrice();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return Product total tax price
|
||||||
|
*
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getCartTotalTaxPrice();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the Checkout currency EUR|USD
|
* Return the Checkout currency EUR|USD
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -103,10 +103,9 @@ class RemoveXPercent extends CouponAbstract
|
|||||||
'Percentage must be inferior to 100'
|
'Percentage must be inferior to 100'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$taxCountry = $this->facade->getContainer()->get('thelia.taxEngine')->getDeliveryCountry();
|
|
||||||
$basePrice = $this->facade->getCart()->getTaxedAmount($taxCountry);
|
|
||||||
|
|
||||||
return round($basePrice * $this->percentage/100, 2);
|
|
||||||
|
return round($this->facade->getCartTotalTaxPrice() * $this->percentage/100, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -63,14 +63,15 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
|||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$currencies = CurrencyQuery::create();
|
|
||||||
$currencies = $currencies->find();
|
|
||||||
|
$currencies = CurrencyQuery::create()->find();
|
||||||
$stubFacade->expects($this->any())
|
$stubFacade->expects($this->any())
|
||||||
->method('getAvailableCurrencies')
|
->method('getAvailableCurrencies')
|
||||||
->will($this->returnValue($currencies));
|
->will($this->returnValue($currencies));
|
||||||
|
|
||||||
$stubFacade->expects($this->any())
|
$stubFacade->expects($this->any())
|
||||||
->method('getCartTotalPrice')
|
->method('getCartTotalTaxPrice')
|
||||||
->will($this->returnValue($cartTotalPrice));
|
->will($this->returnValue($cartTotalPrice));
|
||||||
|
|
||||||
$stubFacade->expects($this->any())
|
$stubFacade->expects($this->any())
|
||||||
|
|||||||
Reference in New Issue
Block a user