mirror of
https://github.com/pestphp/pest.git
synced 2026-09-05 06:13:35 +02:00
Fix repeat with named dataset arguments (#1769)
This commit is contained in:
@@ -44,6 +44,28 @@ test('multiple times with repeat iterator with multiple dataset', function (stri
|
||||
->toBeGreaterThan(0);
|
||||
})->repeat(times: 2)->with(['a', 'b', 'c'], ['d', 'e', 'f']);
|
||||
|
||||
test('multiple times with named dataset arguments', function (string $name, string $email): void {
|
||||
expect($name)
|
||||
->toBeIn(['Taylor', 'Nuno'])
|
||||
->and($email)
|
||||
->toContain('@');
|
||||
})->repeat(times: 2)->with([
|
||||
['name' => 'Taylor', 'email' => 'taylor@laravel.com'],
|
||||
['name' => 'Nuno', 'email' => 'enunomaduro@gmail.com'],
|
||||
]);
|
||||
|
||||
test('multiple times with named dataset arguments and repeat iterator', function (string $name, string $email, int $iteration): void {
|
||||
expect($name)
|
||||
->toBeIn(['Taylor', 'Nuno'])
|
||||
->and($email)
|
||||
->toContain('@')
|
||||
->and($iteration)
|
||||
->toBeIn([1, 2]);
|
||||
})->repeat(times: 2)->with([
|
||||
['name' => 'Taylor', 'email' => 'taylor@laravel.com'],
|
||||
['name' => 'Nuno', 'email' => 'enunomaduro@gmail.com'],
|
||||
]);
|
||||
|
||||
describe('describe blocks', function (): void {
|
||||
test('multiple times', function (): void {
|
||||
expect(true)->toBeTrue();
|
||||
|
||||
Reference in New Issue
Block a user