*/ public function testUnserialize() { $xml = << a 0 b 1 Foo functionName XML; $code = <<<'CODE' /** doc comment */ function functionName(&$a = 0, $b = 1.0) { echo 'Foo'; } CODE; $unserializer = new PHPParser_Unserializer_XML; $prettyPrinter = new PHPParser_PrettyPrinter_Zend; $stmts = $unserializer->unserialize($xml); $this->assertEquals($code, $prettyPrinter->prettyPrint($stmts), '', 0, 10, true); } /** * @expectedException DomainException * @expectedExceptionMessage AST root element not found */ public function testWrongRootElementError() { $xml = << XML; $unserializer = new PHPParser_Unserializer_XML; $unserializer->unserialize($xml); } }