Beispiel #1
0
 public function testDumpXmlFormat()
 {
     if (!class_exists('\\JMS\\Serializer\\SerializerBuilder')) {
         $this->markTestSkipped('Serializer is not available.');
     }
     $var = 1;
     $this->dumper->setFormat(Format\XmlFormat::FORMAT_NAME);
     $dump = new \SimpleXMLElement($this->dumper->dump($var));
     $this->assertEquals(1, $dump->entry->count());
     $this->assertEquals('int', $dump->entry[0]['type']);
     $this->assertEquals('1', $dump->entry[0]->value);
 }
 /**
  * Main constructor
  *
  * @param Dumper $ladybug Ladybyg Dumper
  */
 public function __construct(Dumper $ladybug)
 {
     $this->ladybug = $ladybug;
     $this->ladybug->setFormat('html');
 }