You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use shared datasets to provide data for multiple tests. The dataset uses keys to make the data readable. Not all tests require all parameters from the datasets. So, the dataset contains more items in the array than the parameters needed by the tests.
In Pest 2, this works without any issues. In Pest 3, this setup fails.
It would be great to have the same behavior in Pest 3 as in Pest 2. I want to avoid adding unnecessary parameters to tests that are not used in the test.
In the sample repository, I provide an example.
How to Reproduce
Clone the sample repository
Run composer install
Run ./vendor/bin/pest
The tests fail with this error
FAILED Tests\Unit\ExampleTest > dataset with less parameters count with (1, 1, 1) #2 Error
Unknown named parameter $parameterC
str_replace(): Argument #3 ($subject) must be of type array|string, null given
at vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php:43
39▕ * @return FrameCollection
40▕ */
41▕ public function filter($callable)
42▕ {
➜ 43▕ $this->frames = array_values(array_filter($this->frames, $callable));
44▕ return $this;
45▕ }
46▕
47▕ /**
Change the pest version in the composer.json to ^2.0
What Happened
We use shared datasets to provide data for multiple tests. The dataset uses keys to make the data readable. Not all tests require all parameters from the datasets. So, the dataset contains more items in the array than the parameters needed by the tests.
In Pest 2, this works without any issues. In Pest 3, this setup fails.
It would be great to have the same behavior in Pest 3 as in Pest 2. I want to avoid adding unnecessary parameters to tests that are not used in the test.
In the sample repository, I provide an example.
How to Reproduce
composer install
./vendor/bin/pest
composer.json
to^2.0
./vendor/bin/pest
Sample Repository
https://github.com/lukasleitsch/pest-issue
Pest Version
3.0.4
PHP Version
8.3.11
Operation System
macOS
Notes
No response
The text was updated successfully, but these errors were encountered: