We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following used to work with Pest v2, but throws ErrorException: Undefined array key "user" in Pest v3
ErrorException: Undefined array key "user"
it('demonstrates the issue', function (User $user, mixed $expectedResult) { // assert here })->with(function() { yield 'caseA' => [ 'user' => fn() => User::factory()->create(), 'expectedResult' => true, ]; yield 'caseB' => [ 'user' => fn() => User::factory()->create(), 'expectedResult' => false, ]; });
In Pest v3, all arguments must be wrapped in a closure, instead:
it('demonstrates the issue', function (User $user, mixed $expectedResult) { // assert here })->with(function() { yield 'caseA' => fn() => [ 'user' => User::factory()->create(), 'expectedResult' => true, ]; yield 'caseB' => fn() => [ 'user' => User::factory()->create(), 'expectedResult' => false, ]; });
The main issue is that this seems to be an undocumented breaking change.
See above
No response
3.10
8.3
macOS
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What Happened
The following used to work with Pest v2, but throws
ErrorException: Undefined array key "user"
in Pest v3In Pest v3, all arguments must be wrapped in a closure, instead:
The main issue is that this seems to be an undocumented breaking change.
How to Reproduce
See above
Sample Repository
No response
Pest Version
3.10
PHP Version
8.3
Operation System
macOS
Notes
No response
The text was updated successfully, but these errors were encountered: