Exemple #1
0
 public function testXMLParse()
 {
     $event = new EventDispatcher();
     $file = new File();
     $file->fopen('example.xml');
     $options = new ParseOptions();
     $parser = new XMLParser($event);
     $parser->register();
     $parser->parse($file, $options);
     $this->assertTrue(true);
 }
Exemple #2
0
 public function testXMLParseTwoFiles()
 {
     $event = new EventDispatcher();
     $file = new File();
     $file->fopen('example.yaml');
     $options = new ParseOptions();
     $parser = new YAMLParser($event);
     $this->assertTrue(count($parser->parse($file, $options)) > 0);
     $file = new File();
     $file->fopen('example.yaml');
     $this->assertTrue(count($parser->parse($file, $options)) > 0);
     //var_dump($parser->parse($file,$options));
 }
 public function testXMLParseTwoFiles()
 {
     $event = new EventDispatcher();
     $file = new File();
     $file->fopen('example.xml');
     $options = new ParseOptions();
     $parser = new XMLParser($event);
     $this->assertInstanceOf('\\SimpleXMLElement', $parser->parse($file, $options));
     $file = new File();
     $file->fopen('example.xml');
     $this->assertInstanceOf('\\SimpleXMLElement', $parser->parse($file, $options));
     //var_dump($parser->parse($file,$options));
 }
Exemple #4
0
 /**
  *  @expectedException \Faker\Parser\Exception\CantOpenFile
  */
 public function testOpenBadFile()
 {
     $file = new File();
     $file->fopen('bad_file.xml');
 }