getOptByType(simplexml_load_string(file_get_contents(__DIR__ . '/../../TestFiles/Option/text.xml'))['type']); $obj->fromXML(simplexml_load_string(file_get_contents(__DIR__ . '/../../TestFiles/Option/text.xml'))); /** @var Input $element */ $element = $obj->parseXML(); $this->assertInstanceOf('PSC\Library\Calc\Option\Type\Text', $element); } public function testIfCorrectAttributes() { $parser = new Parser(); /** @var Parser\Input $obj */ $obj = $parser->getOptByType(simplexml_load_string(file_get_contents(__DIR__ . '/../../TestFiles/Option/text.xml'))['type']); $obj->fromXML(simplexml_load_string(file_get_contents(__DIR__ . '/../../TestFiles/Option/text.xml'))); /** @var Input $element */ $element = $obj->parseXML(); $this->assertInstanceOf('PSC\Library\Calc\Option\Type\Text', $element); $this->assertEquals('testtext', $element->getDefault()); $this->assertEquals('t60', $element->getId()); $this->assertEquals('', $element->getName()); } }