예제 #1
0
 public function testXML()
 {
     $xml = simplexml_load_file(__DIR__ . '/test.xml');
     $a = ArrayHelper::toArray($xml);
     $this->assertEquals($a, ['@attributes' => ['backupGlobals' => 'false', 'backupStaticAttributes' => 'false', 'colors' => 'true', 'convertErrorsToExceptions' => 'true', 'convertNoticesToExceptions' => 'true', 'convertWarningsToExceptions' => 'true', 'processIsolation' => 'false', 'stopOnFailure' => 'false', 'syntaxCheck' => 'false', 'bootstrap' => './tests/bootstrap.php'], 'testsuites' => ['testsuite' => ['@attributes' => ['name' => 'PhpCollection Unit Test Suite'], 'directory' => './tests/']]]);
 }
예제 #2
0
파일: XmlHandler.php 프로젝트: hiqdev/hidev
 /**
  * {@inheritdoc}
  */
 public function parsePath($path, $minimal = null)
 {
     $this->_xml = simplexml_load_file(file_exists($path) ? $path : $minimal);
     return ArrayHelper::toArray($this->_xml);
 }