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

TestSuiteLoader will always consider classes from the current file #898

Merged
merged 1 commit into from Aug 6, 2023

Conversation

dylanbr
Copy link
Contributor

@dylanbr dylanbr commented Aug 5, 2023

Q A
Bug fix? yes
New feature? no

I would like to have test classes which extend from other test classes. This allows for a set of test cases to run in the parent class, then the child class can override certain methods, and have the same test cases run.

This works with PHPUnit 10, but when running the same tests via Pest, some of the parent classes are ignored. This happens because of changes in the override to TestSuiteLoader. Once a class is loaded, it's not considered again, so if the child class is loaded before the parent, the parent will never be considered for test cases.

This PR is an attempt to resolve this, but I'd would also like to ask if there is any reason this should not be allowed?

@nunomaduro nunomaduro merged commit 704acbf into pestphp:2.x Aug 6, 2023
14 checks passed
@dylanbr
Copy link
Contributor Author

dylanbr commented Aug 7, 2023

Thanks for the quick review and merge @nunomaduro 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants