pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.48k stars 343 forks source link

Updated Functions::datasets() method by adding $scope parameter #1119

Closed DimionX closed 1 month ago

DimionX commented 6 months ago

What:

Description:

Updated Functions::datasets() method signature by adding $scope optional parameter.

fabio-ivona commented 6 months ago

hi @DimionX could you elaborate more on the need behind this feature?

DimionX commented 6 months ago

hi @DimionX could you elaborate more on the need behind this feature?

Since Dataset Boot connects tests from only one test directory, the limits their use in other scopes. For example, for component or unit tests that are located in the "app" directory, it is impossible to use a dataset that is located in the test directory (tests). Thus, you can manually specify which scope a particular dataset belongs to.

fabio-ivona commented 6 months ago

@DimionX I see, would you mind to add some test for your changes?

nunomaduro commented 1 month ago

Just place those "global" datasets on the "tests/Datasets" folder.