*/ public function testSerialize() { $code = << a 0 b 1 Foo functionName XML; $parser = new PHPParser_Parser; $serializer = new PHPParser_Serializer_XML; $stmts = $parser->parse(new PHPParser_Lexer($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)); } }