mirror of
https://github.com/pestphp/pest.git
synced 2026-09-05 06:13:35 +02:00
fix dataset key
This commit is contained in:
@@ -235,8 +235,8 @@ final class TestCaseMethodFactory
|
|||||||
$attributesCode
|
$attributesCode
|
||||||
public function $methodName(...\$arguments)
|
public function $methodName(...\$arguments)
|
||||||
{
|
{
|
||||||
if (count(\$arguments) === 1 && \$arguments[0] instanceof __PestDatasetProviderError) {
|
if (count(\$arguments) === 1 && \$arguments[array_key_first(\$arguments)] instanceof __PestDatasetProviderError) {
|
||||||
throw \$arguments[0]->getPrevious() ?? \$arguments[0];
|
throw \$arguments[array_key_first(\$arguments)]->getPrevious() ?? \$arguments[array_key_first(\$arguments)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return \$this->__runTest(
|
return \$this->__runTest(
|
||||||
|
|||||||
@@ -542,3 +542,9 @@ test('dataset items can mix named and sequential styles', function (string $name
|
|||||||
['James', 'james@laravel.com'],
|
['James', 'james@laravel.com'],
|
||||||
['James', 'email' => 'james@laravel.com'],
|
['James', 'email' => 'james@laravel.com'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
test('named parameters work with a single argument', function (string $name) {
|
||||||
|
expect($name)->toBe('Taylor');
|
||||||
|
})->with([
|
||||||
|
['name' => 'Taylor'],
|
||||||
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user