Exemplo n.º 1
0
 private TraitAliasTree alias(String toParse) throws Exception {
   TraitAliasTree tree = parse(toParse, PHPLexicalGrammar.TRAIT_ALIAS);
   assertThat(tree.is(Kind.TRAIT_ALIAS)).isTrue();
   assertThat(tree.asToken().text()).isEqualTo("as");
   assertThat(tree.eosToken().text()).isEqualTo(";");
   return tree;
 }
Exemplo n.º 2
0
 @Test
 public void with_alias_and_modifier() throws Exception {
   TraitAliasTree tree = alias("method1 as public method2;");
   assertThat(tree.methodReference().method().text()).isEqualTo("method1");
   assertThat(tree.modifierToken().text()).isEqualTo("public");
   assertThat(tree.alias().text()).isEqualTo("method2");
 }