function testStruct() { $data = array('message' => array('id' => md5(uniqid('message', true)), 'title' => 'Foo')); $xml = RestIP\Helper::arrayToXML($data); $probe = json_decode(json_encode(simplexml_load_string($xml)), true); $this->assertEquals($probe, $data); }
<? $router->contentType('text/xml;charset=UTF-8'); $content = RestIP\Helper::arrayToXML($data, array( 'root_node' => 'response', ), Studip\ENV === 'development'); echo $content;