Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tests: use unique namespace to prevent collisions #1119

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

Merged
ondrejmirtes merged 4 commits into phpstan:1.5.x from staabm:test
Mar 27, 2022

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Mar 25, 2022
edited
Loading

refs #1115

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also drop this unnecessary require

Copy link
Contributor Author

@staabm staabm Mar 25, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this namespace collided with the one in tests/PHPStan/Analyser/data/value-of-enum.php and therefore we get same-class errors when running tests in a single process, see #1115 (comment)

Copy link
Contributor

As mentioned #1115 (comment) this is still not enough.
The default ParaTest behavior is to spawn a new process for each test, and that hides eventual collisions.
The current patch proposed here still raises a fatal error when changes introduced in #1082 are run together in PHPUnit:

$ vendor/bin/phpunit --filter '/(value-of-enum|testValueOfEnum)/' --debug
PHP Fatal error: Cannot declare class ValueOfEnumPhpdoc\Country, because the name is already in use in ./phpstan-src/tests/PHPStan/Rules/PhpDoc/data/value-of-enum.php on line 7

Copy link
Contributor Author

staabm commented Mar 25, 2022

Its an improvement nevertheless, even if its not yet enough for the paratest case

Copy link
Contributor

Sure, I just wanted to make everyone aware ^^

staabm reacted with thumbs up emoji

Copy link
Member

Please fix the build failure.

@ondrejmirtes ondrejmirtes merged commit 2564b16 into phpstan:1.5.x Mar 27, 2022
Copy link
Member

Thank you.

@staabm staabm deleted the test branch March 27, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /