loadFromFile() public method

public loadFromFile ( $filename )
Example #1
0
 public function testAdvancedFile()
 {
     $this->if($object = new testedClass())->then->object($object)->isInstanceOf('RomaricDrigon\\MetaYaml\\Loader\\XmlLoader')->array($object->loadFromFile('test/data/TestXml/TestBase.xml'))->isEqualTo(array('fleurs' => array('roses' => array('couleur' => 'rose', 'opera' => 'une rose', 'sauvage' => array('des_bois' => 'une autre rose', 'des_sous_bois' => array('sauvage' => 'oui', '_value' => 'encore'))), 'tulipe' => 'deuxieme tulipe', 'violette' => array('couleur' => 'violette', 'sauvage' => 'false', '_value' => 'une violette'))));
 }
 public function testXmlBase()
 {
     $this->if($loader = new XmlLoader())->and($data = $loader->loadFromFile('test/data/TestXml/TestBase.xml'))->and($config = $loader->loadFromFile('test/data/TestXml/Schema.xml'))->and($object = new testedClass())->then->boolean($object->validate($config, $data))->isEqualTo(true);
 }