public void testDeleteClassElements() throws Exception {
String str = "<?php final class MyClass extends SuperClass implements Interface1, Interface2 { const MY_CONSTANT = 3; public static final $myVar = 5, $yourVar; var $anotherOne; private function myFunction(MyClass $a, $b = 6) { } } ?>";
String expected = "<?php final class MyClass extends SuperClass { } ?>";
parseAndCompare(str, expected, new ICodeManiplator() {
public void manipulate(Program program) {
ClassDeclaration statement = (ClassDeclaration) program
.statements().get(0);
statement.interfaces().remove(1);
statement.interfaces().remove(0);
statement.getBody().statements().remove(3);
statement.getBody().statements().remove(2);
statement.getBody().statements().remove(1);
statement.getBody().statements().remove(0);
}
});
}