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

Make the TestCaseCovers sniff to detect multiple @coversDefaultClass cases #166

Closed
stronk7 opened this issue Jun 9, 2024 · 1 comment · Fixed by #167
Closed

Make the TestCaseCovers sniff to detect multiple @coversDefaultClass cases #166

stronk7 opened this issue Jun 9, 2024 · 1 comment · Fixed by #167
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stronk7
Copy link
Member

stronk7 commented Jun 9, 2024

Recently I was playing with code-coverage generation and when running PHPUnit it was detected that we have a few unit tests having multiple @coversDefaultClass annotations.

That's plain wrong, only one is allowed (in fact PHPUnit stops when that happens). Such an annotation is about to define the default class to apply when the @covers annotations do no specify a class. Just that.

So we should start erroring in the Sniff when multiple are detected. Of course, only that annotation, classes and methods are allowed to have multiple @covers ones.

Ciao :-)

@stronk7 stronk7 added enhancement New feature or request good first issue Good for newcomers labels Jun 9, 2024
@stronk7
Copy link
Member Author

stronk7 commented Jun 10, 2024

Cross-linking with MDL-82148 that is the one going to fix current cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant