mirror of
https://github.com/pestphp/pest.git
synced 2026-04-20 22:20:17 +02:00
Improvements
This commit is contained in:
@ -360,7 +360,7 @@ trait Testable
|
||||
}
|
||||
|
||||
$parameterType = is_string($argumentIndex)
|
||||
? ($testParameterTypesByName[$argumentIndex] ?? 'mixed')
|
||||
? $testParameterTypesByName[$argumentIndex]
|
||||
: $testParameterTypes[$argumentIndex];
|
||||
|
||||
if (in_array($parameterType, [Closure::class, 'callable', 'mixed'])) {
|
||||
|
||||
@ -533,3 +533,12 @@ test('named parameters work with bound closure returning associative array', fun
|
||||
return ['name' => $this->foo, 'email' => 'test@example.com'];
|
||||
},
|
||||
]);
|
||||
|
||||
test('dataset items can mix named and sequential styles', function (string $name, string $email) {
|
||||
expect($name)->toBeString();
|
||||
expect($email)->toContain('@');
|
||||
})->with([
|
||||
['name' => 'Taylor', 'email' => 'taylor@laravel.com'],
|
||||
['James', 'james@laravel.com'],
|
||||
['James', 'email' => 'james@laravel.com'],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user