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