Exemplo n.º 1
0
 public void testPhp54TraitsDifferentFile() {
   EditorOperator file = CreatePHPFile(TEST_PHP_NAME, "PHP File", "TraitTest");
   startTest();
   file.setCaretPosition("*/", false);
   TypeCode(file, "\n namespace testA; \n trait Test{ \n public function test(){}");
   file.save();
   file = CreatePHPFile(TEST_PHP_NAME, "PHP File", "TraitTest2");
   file.setCaretPosition("*/", false);
   TypeCode(file, "\n class Bar{ \n use testA\\Test; \n public function testfoo(){\n $this->");
   file.typeKey(' ', InputEvent.CTRL_MASK);
   new EventTool().waitNoEvent(1000);
   CompletionInfo jCompl = GetCompletion();
   String[] ideal = {"test", "testfoo"};
   CheckCompletionItems(jCompl.listItself, ideal);
   endTest();
 }
Exemplo n.º 2
0
 public void testPhp54TraitsSameFile() {
   EditorOperator file = CreatePHPFile(TEST_PHP_NAME, "PHP File", null);
   startTest();
   file.setCaretPosition("*/", false);
   TypeCode(
       file,
       "trait Test{ \n public function test(){} \n } \n class Foo{ \n use Test; \n function bar(){\n $this->");
   file.typeKey(' ', InputEvent.CTRL_MASK);
   new EventTool().waitNoEvent(1000);
   CompletionInfo jCompl = GetCompletion();
   String[] ideal = {"test", "bar"};
   CheckCompletionItems(jCompl.listItself, ideal);
   endTest();
 }
  protected void expandFoldAtCaretPosition(EditorOperator editor, int line, int column) {
    // 1. move to adequate place
    editor.setCaretPosition(line, column);

    // 2. hit CTRL +
    JEditorPaneOperator txtOper = editor.txtEditorPane();
    txtOper.pushKey(KeyEvent.VK_ADD, KeyEvent.CTRL_DOWN_MASK);

    JTextComponentOperator text = new JTextComponentOperator(editor);
    JTextComponent target = (JTextComponent) text.getSource();

    // give max 500 milis to fold to expand
    waitMaxMilisForValue(500, getResolver(target), Boolean.FALSE);
  }
Exemplo n.º 4
0
 public void testBasicIndentation() {
   oper.setCaretPosition(279, 1);
   oper.pushEndKey();
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.txtEditorPane().typeText("public void method(boolean cond1");
   oper.pushEndKey();
   oper.txtEditorPane().typeText("{");
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.txtEditorPane().typeText("if(cond1");
   oper.pushEndKey();
   oper.txtEditorPane().typeText("sout");
   oper.pushTabKey();
   oper.txtEditorPane().typeText("Hello");
   oper.pushEndKey();
 }
Exemplo n.º 5
0
 public void testAdvancedIndentation() {
   oper.setCaretPosition(120, 1);
   end();
   enter();
   enter();
   type("public void method(");
   end();
   type(" {");
   enter();
   type("while(true");
   end();
   type(" {");
   enter();
   type("if(true");
   end();
   enter();
   type("if(false");
   end();
   type(" {");
   enter();
   type("int i = ");
   enter();
   type("1;");
 }