Fixes
This commit is contained in:
parent
0b25641c35
commit
ae27792eac
@ -231,6 +231,17 @@ class Engine
|
||||
* @return mixed
|
||||
*/
|
||||
public function getTaxPrice()
|
||||
{
|
||||
if($this->dirty) {
|
||||
$this->calc();
|
||||
}
|
||||
return round(($this->price/100*$this->tax),2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCompletePrice()
|
||||
{
|
||||
if($this->dirty) {
|
||||
$this->calc();
|
||||
|
||||
@ -34,7 +34,8 @@ class PriceMinTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals(2500, $this->engine->getPrice());
|
||||
$this->engine->setTax(19);
|
||||
$this->assertEquals(2975, $this->engine->getTaxPrice());
|
||||
$this->assertEquals(475, $this->engine->getTaxPrice());
|
||||
$this->assertEquals(2975, $this->engine->getCompletePrice());
|
||||
}
|
||||
|
||||
public function testIfCalcReturnsGrenzeWithFormular()
|
||||
@ -50,6 +51,9 @@ class PriceMinTest extends \PHPUnit_Framework_TestCase
|
||||
$this->engine->calc();
|
||||
|
||||
$this->assertEquals(2721.40, $this->engine->getPrice());
|
||||
$this->engine->setTax(19);
|
||||
$this->assertEquals(517.07, $this->engine->getTaxPrice());
|
||||
$this->assertEquals(3238.47, $this->engine->getCompletePrice());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user