@@ -23,6 +23,7 @@ import com.intellij.util.Consumer
2323import com.jetbrains.php.PhpBundle
2424import com.jetbrains.php.PhpIndex
2525import com.jetbrains.php.lang.psi.PhpFile
26+ import com.jetbrains.php.lang.psi.elements.Function
2627import com.jetbrains.php.lang.psi.elements.Method
2728import com.jetbrains.php.lang.psi.elements.PhpClass
2829import com.jetbrains.php.lang.psi.elements.PhpNamedElement
@@ -51,9 +52,9 @@ class TestoRunConfigurationProducer : PhpTestConfigurationProducer<TestoRunConfi
5152
5253 return super .setupConfiguration(testRunnerSettings, element.containingFile, element.containingFile.virtualFile)
5354 }
54- if (element is Method ) {
55+ if (element is Function ) {
5556 val element = findTestElement(element, getWorkingDirectory(element))
56- if (element is Method ) {
57+ if (element is Function ) {
5758 val usages = TestoDataProviderUtils .findDataProviderUsages(element)
5859
5960 if (usages.isNotEmpty()) {
@@ -77,7 +78,7 @@ class TestoRunConfigurationProducer : PhpTestConfigurationProducer<TestoRunConfi
7778 else -> true
7879 }
7980 }
80- if (element is Method ) {
81+ if (element is Function ) {
8182 val usages = TestoDataProviderUtils .findDataProviderUsages(element)
8283
8384 if (usages.isNotEmpty()) {
@@ -180,7 +181,7 @@ class TestoRunConfigurationProducer : PhpTestConfigurationProducer<TestoRunConfi
180181 else -> null
181182 }
182183 }
183- val method = PsiTreeUtil .getNonStrictParentOfType(element, Method ::class .java)
184+ val method = PsiTreeUtil .getNonStrictParentOfType(element, Function ::class .java)
184185 if (method != null && method.isTestoExecutable()) {
185186 return method
186187 }
@@ -381,7 +382,7 @@ class TestoRunConfigurationProducer : PhpTestConfigurationProducer<TestoRunConfi
381382 val METHOD = Condition <PsiElement > {
382383 it.isTestoExecutable() || (it is Method && TestoDataProviderUtils .isDataProvider(it))
383384 }
384- private val METHOD_NAMER = { element: PsiElement ? -> (element as ? com.jetbrains.php.lang.psi.elements. Function )?.name }
385+ private val METHOD_NAMER = { element: PsiElement ? -> (element as ? PhpNamedElement )?.name }
385386 private val FILE_TO_SCOPE = { file: PsiFile ? ->
386387 file
387388 ?.takeIf { it.isTestoFile() }
0 commit comments