File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/main/java/de/espend/idea/php/phpunit/utils Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ public static boolean isTestClassWithoutIndexAccess(@NotNull PhpClass phpClass)
7676 }
7777
7878 for (String interfaceName : phpClass .getInterfaceNames ()) {
79- String interfaceName2 = "\\ " + StringUtils .stripStart (interfaceName , "\\ " );
80- if (interfaceName2 .equalsIgnoreCase ("\\ Behat\\ Behat\\ Context\\ Context" )) {
79+ String interfaceNameNormalized = "\\ " + StringUtils .stripStart (interfaceName , "\\ " );
80+ if (interfaceNameNormalized .equalsIgnoreCase ("\\ Behat\\ Behat\\ Context\\ Context" )) {
8181 return true ;
8282 }
8383 }
@@ -87,7 +87,16 @@ public static boolean isTestClassWithoutIndexAccess(@NotNull PhpClass phpClass)
8787 for (VirtualFile contentRoot : ProjectRootManager .getInstance (phpClass .getProject ()).getContentRoots ()) {
8888 String relativePath = VfsUtil .getRelativePath (containingFile1 , contentRoot , '/' );
8989
90- if (relativePath != null && (relativePath .toLowerCase ().contains ("/test/" ) || relativePath .toLowerCase ().contains ("/tests/" ))) {
90+ if (relativePath == null ) {
91+ continue ;
92+ }
93+
94+ // PhpUnit and Behat folder structure
95+ if (relativePath .toLowerCase ().contains ("/test/" ) ||
96+ relativePath .toLowerCase ().contains ("/tests/" ) ||
97+ relativePath .toLowerCase ().contains ("/feature/" ) ||
98+ relativePath .toLowerCase ().contains ("/features/" )
99+ ) {
91100 return true ;
92101 }
93102 }
You can’t perform that action at this time.
0 commit comments