-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Trigger a test runner warning when both attributes and annotations are used #6336
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
base: 10.5
Are you sure you want to change the base?
Conversation
if (!$attributes->isEmpty()) { | ||
if (!$annotations->isEmpty()) { | ||
EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( | ||
'PHPDoc annotations will be ignored when attributes are declared', |
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.
maybe we need to be more precise here, that we talk only about PHPUnit related annotations.. ?
wording suggestions welcome.
when projects support a wide range of php versions, they likely need to run their test-suite across multiple phpunit versions (therefore they might configure their tests with phpdoc and attributes in tandem) see e.g. PHP-CS-Fixer/PHP-CS-Fixer#8965 (comment) the warning might get annoying in such cases |
if (!$attributes->isEmpty()) { | ||
if (!$annotations->isEmpty()) { |
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.
In projects with old PHP versions support, multiple PHPUnit versions needs to be supported.
In order to be able to run multiple PHPUnit versions, annotations might be needed to be supported together with attributes.
The warning should be only if the annotations and attributes does not equal.
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.
The warning should be only if the annotations and attributes does not equal.
This is not possible without parsing the annotations and PHPUnit >= 12 does not have the code for that anymore.
multiple PHPUnit versions needs to be supported
I disagree.
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.
Ok, so seems this is ready to land
closes #6335