43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
namespace PSC\Library\Calc\Tests\Calc;
|
|
|
|
use PSC\Library\Calc\Article;
|
|
use PSC\Library\Calc\Engine;
|
|
use PSC\Library\Calc\Option\Type\Base;
|
|
use PSC\Library\Calc\PaperContainer\Container;
|
|
|
|
class PreisPauschaleTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
/** @var Engine */
|
|
protected $engine = null;
|
|
|
|
public function setUp()
|
|
{
|
|
$this->engine = new Engine(new Container());
|
|
$this->engine->loadString(file_get_contents(__DIR__ . '/../TestFiles/Calc/pauschale_preis.xml'));
|
|
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
$this->engine = null;
|
|
}
|
|
|
|
public function testIfArticleCountIsCorrect()
|
|
{
|
|
$this->assertEquals(1, $this->engine->getArticles()->Count());
|
|
}
|
|
|
|
public function testPreisPauschaleCalc()
|
|
{
|
|
$this->engine->calc();
|
|
|
|
$this->assertEquals(110, $this->engine->getPrice());
|
|
$this->engine->setVariables(['auflage' => 50]);
|
|
$this->assertEquals(270, $this->engine->getPrice());
|
|
$this->engine->setVariables(['auflage' => 250]);
|
|
$this->assertEquals(0, $this->engine->getPrice());
|
|
|
|
}
|
|
|
|
} |