engine = new Engine(new Container()); $this->engine->loadString(file_get_contents(__DIR__ . '/../TestFiles/Calc/option_remove.xml')); } public function tearDown() { $this->engine = null; } public function testIfArticleCountIsCorrect() { $this->assertEquals(1, $this->engine->getArticles()->Count()); } public function testIfParserGetArticleCorrect() { $article = $this->engine->getArticleByName('test1'); $this->assertEquals('test1', $article->getName()); $this->assertEquals(2, count($article->getOptions())); } public function testIfOptionsNotValid() { $this->engine->setParameters([]); $this->engine->setFormulas([]); $this->engine->setVariables([]); $this->engine->calc('test1'); /** @var Article $article */ $article = $this->engine->getArticleByName('test1'); /** @var Base $option */ $option = $article->getOptionById('gebwert'); $this->assertTrue($option->isValid()); $this->engine->setVariables(['gebyn' => 2]); $this->engine->calc('test1'); $option = $article->getOptionById('gebwert'); $this->assertFalse($option->isValid()); } }