addVisitor(new PHPParser_NodeVisitor_NameResolver); $stmts = $parser->parse(new PHPParser_Lexer($code)); $stmts = $traverser->traverse($stmts); $this->assertEquals($expectedCode, $prettyPrinter->prettyPrint($stmts)); } }