-
Notifications
You must be signed in to change notification settings - Fork 545
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
Conversation
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
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
Its an improvement nevertheless, even if its not yet enough for the paratest case
Sure, I just wanted to make everyone aware ^^
Please fix the build failure.
other tests in the same folder do not use it either
Thank you.
Uh oh!
There was an error while loading. Please reload this page.
refs #1115