Ejemplo n.º 1
0
 /**
  * Transform to XML
  *
  * @param string $root - root element
  * @param array $config - configuration
  *
  * @return \Serializers\Encoders\Xml
  *
  * @since 1.0
  */
 public function toXml($root, array $config = array())
 {
     $xml = Encode::toXml($root, $this->toArray(), $config);
     return $xml;
 }
Ejemplo n.º 2
0
 /**
  * Tests bad element name, e.g numeric indexes in array
  *
  * @expectedException RuntimeException
  */
 public function testEncodeBadInput()
 {
     $input = array_values($this->generageArray());
     $xml = Encode::toXml('root', $input);
     $xml->load();
 }