engine = new Engine(new Container()); $this->engine->loadString(file_get_contents(__DIR__ . '/../TestFiles/Calc/colors.xml')); } public function tearDown(): void { $this->engine = null; } public function testIfOptionsNotValid() { $this->engine->calc(); /** @var Article $article */ $article = $this->engine->getArticle(); /** @var Base $option */ $option = $article->getOptionById('colorpantone'); $this->assertTrue($option->isValid()); $this->assertSame('142', $option->getSelectedOption()->getId()); $option = $article->getOptionById('colorhks'); $this->assertTrue($option->isValid()); $this->assertSame('78', $option->getSelectedOption()->getId()); } public function testSetVar() { $this->engine->setVariable('colorpantone', '128'); $this->engine->calc(); $this->assertSame( '128', $this->engine ->getArticle() ->getOptionById('colorpantone') ->getRawValue(), ); } }