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

Fix parallel execution of test class that extends another class with same name #748

Merged
merged 2 commits into from Mar 29, 2023

Conversation

ncharalampidis
Copy link
Contributor

Q A
Bug fix? yes
New feature? no

A test class that extends another class with the same name but in different directory is not loaded in parallel execution. The TestSuiteLoader gets confused and loads the parent class instead.

The confusion comes from this line:
if ($class->isAbstract() || ($class->getFileName() !== $suiteClassFile)) {

It's because the getFileName() returns the absolute path while the suiteClassFile contains the relative path. This does not seem to be the case for normal execution.

I have added a test that reproduces the issue along with the fix.

@nunomaduro nunomaduro merged commit 152b7a9 into pestphp:2.x Mar 29, 2023
14 checks passed
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