-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
[2.x] Add covers
attribute
#492
[2.x] Add covers
attribute
#492
Conversation
@danilopolani Looking very interesting so far! |
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.
Quick few things, but looks great to me! Thanks for adding the tests too! 🥳
Brilliant work here 👌 |
@owenvoke thank you for the review! At the end I've moved Let me know if you prefer me to remove it because not needed or if it's fine :) |
Thank you for this! We may reach in the future, asking for docs about this. ✅ |
Thank you Nuno! No problem, if you want I can already work on the PR for the docs 👀 |
@danilopolani Can you check what static types errors we have on master, and pull request a fix? Or they are not related to your PR? |
Yep sorry, I forgot to run |
This PR tries to implement the
@covers
annotation. Actually, following the issue sebastianbergmann/phpunit#4502 , I decided to implement it as a PHP Attribute since the annotations will be deprecated in PHPUnit 11.I haven't tested this yet because I started working on it on Windows and 90% of the commands do not work, will come back on this in the next few days.
Because of the logic of Pest (where final user does not have a class), I think it's not possible to implement the
@coversDefaultClass
, but that's not a big deal since the other methods works just fine without it.Usage
Todo
only allowed on classes; @covers was allowed on methods but it does not make sense to mix different coverage targets in a test case class
)