Esempio n. 1
0
 public function testtoArrayReturnsArrayRepresenationOfYamlObject()
 {
     $expected = ['foo' => 'bar'];
     $parser = new XmlParser('<xml><foo>bar</foo></xml>');
     $x = new YamlParser($parser->toYaml());
     $this->assertEquals($expected, $x->toArray());
 }
Esempio n. 2
0
 public function testtoJsonReturnsJsonRepresentationOfXmlObject()
 {
     $expected = '{"foo":"bar"}';
     $parser = new XmlParser('<xml><foo>bar</foo></xml>');
     $this->assertEquals($expected, $parser->toJson());
 }