Esempio n. 1
0
 /**
  * @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);
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 private function load()
 {
     $xmlStr = FileUtils::getFileContent($this->xmlFile);
     $this->xml = new SimpleXMLElement($xmlStr);
 }
Esempio n. 4
0
 private function load()
 {
     $xmlStr = FileUtils::getFileContent($this->getConfigFilePath());
     $this->xml = new SimpleXMLElement($xmlStr, LIBXML_NOCDATA);
 }