public function testInsertForms() { $xml = new SimpleXMLElement(file_get_contents($this->getStreamPath("Config/config.xml"))); $parser = new ConfigParser(); $config = $parser->parseXml($xml); $forms = $config->getForms(); $this->assertCount(1, $forms); $form = array_pop($forms); $this->assertEquals("theliastudiotestmodule.configuration", $form->getName()); $this->assertEquals("TheliaStudioTestModule\\Form\\TheliaStudioTestModuleConfigForm", $form->getClass()); }
protected function parseConfigXml($modulePath) { /** * Get current configuration */ $configData = @file_get_contents($configPath = $modulePath . "Config" . DS . "config.xml"); if (false === $configData) { throw new \Exception("missing file 'config.xml'"); } $configParser = new ConfigParser(); $xml = new SimpleXMLElement($configData); /** @var Config $config */ return [$xml, $configPath, $configParser->parseXml($xml)]; }