public void testDeleteSwitch() throws Exception {
String str = "<?php switch ($i) { case 0: echo 'i equals 0'; break; case 1: echo 'i equals 1'; break; default: echo 'i not equals 0,1'; } ?>";
String expected = "<?php switch ($i) { case 0: echo 'i equals 0'; break; default: echo 'i not equals 0,1'; } ?>";
parseAndCompare(str, expected, new ICodeManiplator() {
public void manipulate(Program program) {
SwitchStatement statement = (SwitchStatement) program
.statements().get(0);
statement.getBody().statements().remove(1);
}
});
}