*/ public function testSerialize() { $code = << a 0 b 1 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)); } }