Skip to content
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

Apply test case to specific groups OR override test case in specific test file #765

Closed
calebdw opened this issue Apr 3, 2023 · 1 comment

Comments

@calebdw
Copy link
Contributor

calebdw commented Apr 3, 2023

Hello,

I have several types of tests that have their own parent Test Case (e.g., like Validator classes). However, we follow a DDD layout and don't want to place all of the validators in a single directory.

Ideally, I'd like to be able to specify a parent test case for a group of tests like so:

// Pest.php
uses(ValidatorTestCase::class)->group('validators');
uses(TestCase::class)->in('Feature');


// test file in `Feature/some/path/to/Validators/`
uses()->group('validators')

Another solution would be to just override the test case used in that particular file:

// test file in `Feature/some/path/to/Validators/`
uses(ValidatorTestCase::class)->group('validators');

however, this yields a folder already uses the test case 'Tests\TestCase' exception.

The first solution would be the best and most robust as there wouldn't be a ton of duplicate calls throughout the tests.

Thanks!

@nunomaduro
Copy link
Member

This seems a feature request - and are free to submit a pull request that adds this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants