-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
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
feat: add support for using Finder objects for uses()
#312
Conversation
You can just set the dir name (in this case, " use Symfony\Component\Finder\Finder;
uses(Tests\TestCase::class)->inFinder(
Finder::create()
->name('Feature')
->directories()
->in(__DIR__)
); Just to be clear, the parameter is a Finder instance for not add Symfony/Finder to Pest dependencies? |
Yeah, the parameter is a |
Can’t we make the “in” method accept a string or a instance of Finder? |
Also, can you add a test for this? Maybe add a new folder that extends a specific test case. |
cc @owenvoke |
Apologies, I'd lost track of this. I'd thought about adding it directly to the |
@owenvoke What's the current state of this pull request? |
No plans for this, thanks! |
This came up on Discord where it was asked whether it was possible to provide something such as globs (e.g.
**/Feature
) to theuses()->in()
call. This will basically throw aShouldNotHappen
exception if theFinder
class doesn't exist, and the usualuses()->in()
call can be used as normal.For example, here's how you could specify all
Feature
subdirectories to use a specific testcase class.