fix taxengine tests

This commit is contained in:
Etienne Roudeix
2013-09-11 20:18:34 +02:00
parent fa5c1aaefc
commit c35de47f10
2 changed files with 45 additions and 7 deletions

View File

@@ -74,6 +74,11 @@ class Calculator
}
public function getTaxAmount($untaxedPrice)
{
return $this->getTaxedPrice($untaxedPrice) - $untaxedPrice;
}
public function getTaxedPrice($untaxedPrice)
{
if(null === $this->taxRulesCollection) {
throw new TaxEngineException('Tax rules collection is empty in Calculator::getTaxAmount', TaxEngineException::UNDEFINED_TAX_RULES_COLLECTION);
@@ -106,9 +111,4 @@ class Calculator
return $taxedPrice;
}
public function getTaxedPrice($untaxedPrice)
{
return $untaxedPrice + $this->getTaxAmount($untaxedPrice);
}
}