-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature/code-coverageIssues related to code coverage (but not php-code-coverage)Issues related to code coverage (but not php-code-coverage)feature/metadata/attributestype/enhancementA new idea that should be implementedA new idea that should be implemented
Milestone
Description
In PHPUnit 10.0, attributes were added to (optionally) replace code comment annotations (great feature btw!). However, these are currently limited only to apply to classes, where previously covers attributes were allowed to be on methods as well.
It would be fruitful for some usecases (as mentioned in various comments below) to allow for more fine-grained coverage measurement; in particular to allow targetting (class) methods by name using attributes.
Note: if this is an intentional change, and there is no plan to actively support this anymore, maybe this should be turned into two other issues:
add a deprecation message for covers attributes on methodsan issue on the Rector Rules repository to not automatically convert method-based covers annotations into attributes, as it will result into a broken tests suite (Attribute "PHPUnit\Framework\Attributes\CoversClass" cannot target method (allowed targets: class)
)
jrfnl and adamaverayravage84
Metadata
Metadata
Assignees
Labels
feature/code-coverageIssues related to code coverage (but not php-code-coverage)Issues related to code coverage (but not php-code-coverage)feature/metadata/attributestype/enhancementA new idea that should be implementedA new idea that should be implemented