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