Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.IfStatement


  public void testDeleteBlockFirst() throws Exception {
    String str = "<?php if ($a) { $a = 5; $b = 4; $c = 4; }  ?>";
    String expected = "<?php if ($a) { $b = 4; $c = 4; }  ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(0);
      }
    });
  }
View Full Code Here


  public void testDeleteBlockMiddle() throws Exception {
    String str = "<?php if ($a) { $a = 5; $b = 4; }  ?>";
    String expected = "<?php if ($a) { $a = 5; }  ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(1);
      }
    });
  }
View Full Code Here

  public void testDeleteBlockLast() throws Exception {
    String str = "<?php if ($a) { $a = 5; $b = 4; $c = 4;}  ?>";
    String expected = "<?php if ($a) { $a = 5; $b = 4;}  ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        IfStatement statement = (IfStatement) program.statements().get(
            0);
        Block block = (Block) statement.getTrueStatement();
        block.statements().remove(2);
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.IfStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.