Skip to content

Commit 8d485f1

Browse files
Do not invoke data provider method using Reflection API
1 parent 8540e10 commit 8d485f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Metadata/Api/DataProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ private function dataProvidedByMethods(string $className, string $methodName, Me
110110
try {
111111
$class = new ReflectionClass($_dataProvider->className());
112112
$method = $class->getMethod($_dataProvider->methodName());
113-
$object = null;
114113

115114
if (!$method->isPublic()) {
116115
throw new InvalidDataProviderException(
@@ -142,7 +141,9 @@ private function dataProvidedByMethods(string $className, string $methodName, Me
142141
);
143142
}
144143

145-
$data = $method->invoke($object);
144+
$className = $_dataProvider->className();
145+
$methodName = $_dataProvider->methodName();
146+
$data = $className::$methodName();
146147
} catch (Throwable $e) {
147148
Event\Facade::emitter()->dataProviderMethodFinished(
148149
$testMethod,

0 commit comments

Comments
 (0)