Dataset Named Parameters

This commit is contained in:
dbpolito
2026-02-11 17:57:07 -03:00
parent 3a4329ddc7
commit c61dcad42b
2 changed files with 85 additions and 3 deletions

View File

@ -350,7 +350,8 @@ trait Testable
}
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
$testParameterTypes = array_values(Reflection::getFunctionArguments($underlyingTest));
$testParameterTypesByName = Reflection::getFunctionArguments($underlyingTest);
$testParameterTypes = array_values($testParameterTypesByName);
if (count($arguments) !== 1) {
foreach ($arguments as $argumentIndex => $argumentValue) {
@ -358,7 +359,11 @@ trait Testable
continue;
}
if (in_array($testParameterTypes[$argumentIndex], [Closure::class, 'callable', 'mixed'])) {
$parameterType = is_string($argumentIndex)
? ($testParameterTypesByName[$argumentIndex] ?? 'mixed')
: ($testParameterTypes[$argumentIndex] ?? 'mixed');
if (in_array($parameterType, [Closure::class, 'callable', 'mixed'])) {
continue;
}
@ -384,7 +389,7 @@ trait Testable
return [$boundDatasetResult];
}
return array_values($boundDatasetResult);
return $boundDatasetResult;
}
/**