/** * @covers FileUtils::getFileContent */ public function testGetFileContent() { $content = \FileUtils::getFileContent("tests/config/menu.xml"); $actual = explode("\n", $content)[0]; $actual = trim($actual); $excepted = '<?xml version="1.0"?>'; $this->assertEquals($excepted, $actual); }
private static function loadResourceBundle($bundleName, $bundlePath) { $map = array(); $xmlStr = FileUtils::getFileContent($bundlePath); $xml = new SimpleXMLElement($xmlStr); foreach ($xml->string as $str) { $stringId = (string) $str['id']; $stringVal = (string) $str['value']; $map[$stringId] = $stringVal; } self::$bundles[$bundlePath] = $map; }
private function load() { $xmlStr = FileUtils::getFileContent($this->xmlFile); $this->xml = new SimpleXMLElement($xmlStr); }
private function load() { $xmlStr = FileUtils::getFileContent($this->getConfigFilePath()); $this->xml = new SimpleXMLElement($xmlStr, LIBXML_NOCDATA); }