*/ public function testSerialize() { $code = << // comment /** doc comment */ 4 6 functionName 4 4 a 4 4 0 4 4 b 4 4 1 5 5 5 5 Foo XML; $parser = new PhpParser\Parser(new PhpParser\Lexer); $serializer = new XML; $stmts = $parser->parse($code); $this->assertXmlStringEqualsXmlString($xml, $serializer->serialize($stmts)); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Unexpected node type */ public function testError() { $serializer = new XML; $serializer->serialize(array(new \stdClass)); } }