Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Mar 25, 2022

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

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)

@Slamdunk
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

@staabm
Copy link
Contributor Author

staabm commented Mar 25, 2022

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

@Slamdunk
Copy link
Contributor

Sure, I just wanted to make everyone aware ^^

@ondrejmirtes
Copy link
Member

Please fix the build failure.

@ondrejmirtes ondrejmirtes merged commit 2564b16 into phpstan:1.5.x Mar 27, 2022
@ondrejmirtes
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants