@@ -373,22 +373,31 @@ public void testGetTwigMacroNameAndParameter() {
373
373
public void testGetControllerMethodShortcut () {
374
374
myFixture .copyFileToProject ("controller_method.php" );
375
375
376
- myFixture .configureByText (PhpFileType .INSTANCE , "<?php\n " +
377
- "namespace FooBundle\\ Controller;\n " +
378
- "class FoobarController\n " +
379
- "{\n " +
380
- " public function fo<caret>obarAction() {}\n " +
381
- "" +
382
- "}\n "
383
- );
384
-
385
- PsiElement psiElement = myFixture .getFile ().findElementAt (myFixture .getCaretOffset ());
386
-
387
- List <String > strings = Arrays .asList (TwigUtil .getControllerMethodShortcut ((Method ) psiElement .getParent ()));
388
-
389
- assertContainsElements (strings , "FooBundle:Foobar:foobar.html.twig" );
390
- assertContainsElements (strings , "FooBundle:Foobar:foobar.json.twig" );
391
- assertContainsElements (strings , "FooBundle:Foobar:foobar.xml.twig" );
376
+ Collection <String []> dataProvider = new ArrayList <String []>() {{
377
+ add (new String [] {"fo<caret>obarAction" , "foobar" });
378
+ add (new String [] {"fo<caret>obar" , "foobar" });
379
+ add (new String [] {"editAction" , "edit" });
380
+ add (new String [] {"ed<caret>it" , "edit" });
381
+ }};
382
+
383
+ for (String [] string : dataProvider ) {
384
+ myFixture .configureByText (PhpFileType .INSTANCE , "<?php\n " +
385
+ "namespace FooBundle\\ Controller;\n " +
386
+ "class FoobarController\n " +
387
+ "{\n " +
388
+ " public function " + string [0 ] + "() {}\n " +
389
+ "" +
390
+ "}\n "
391
+ );
392
+
393
+ PsiElement psiElement = myFixture .getFile ().findElementAt (myFixture .getCaretOffset ());
394
+
395
+ List <String > strings = Arrays .asList (TwigUtil .getControllerMethodShortcut ((Method ) psiElement .getParent ()));
396
+
397
+ assertContainsElements (strings , "FooBundle:Foobar:" + string [1 ] + ".html.twig" );
398
+ assertContainsElements (strings , "FooBundle:Foobar:" + string [1 ] + ".json.twig" );
399
+ assertContainsElements (strings , "FooBundle:Foobar:" + string [1 ] + ".xml.twig" );
400
+ }
392
401
}
393
402
394
403
public void testGetControllerMethodShortcutForInvoke () {
0 commit comments