Beispiel #1
0
 public function testVFileOpen()
 {
     $vfile = new VFile($this->str);
     $vfile->fopen('dummy.xml');
     $this->assertTrue(true);
     $vfile = new Vfile('string://' . $this->str);
     $this->assertTrue(true);
 }
Beispiel #2
0
 public function testXMLParseVFile()
 {
     $event = new EventDispatcher();
     $file = new VFile($this->str);
     $file->fopen('example.yaml');
     $options = new ParseOptions();
     $parser = new YAMLParser($event);
     $this->assertTrue(count($parser->parse($file, $options)) > 0);
 }
 /**
  *  @expectedException Faker\Parser\Exception
  *  @expectedExceptionMessage Fatal Error 5: Extra content at the end of the document
  */
 public function testXMLParseVFileBad()
 {
     $event = new EventDispatcher();
     $file = new VFile('<to>Tove</to> <from>Jani</from><heading><inner>innerval</inner></heading><body>Don\'t forget me this weekend!</body></note>');
     $file->fopen('example.xml');
     $options = new ParseOptions();
     $parser = new XMLParser($event);
     $this->assertInstanceOf('\\SimpleXMLElement', $parser->parse($file, $options));
 }