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

Implicitly include (abstract) parent class with #[CoversClass] and #[UsesClass] attributes #5733

Closed
spriebsch opened this issue Mar 10, 2024 · 0 comments
Assignees
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/metadata Issues related to attributes and annotations type/enhancement A new idea that should be implemented
Milestone

Comments

@spriebsch
Copy link

Code Coverage: when I'm testing a concrete class that extends an abstract base class, I have to create annotations for both.

Since it's technically not possible to test a subclass in isolation from its base class, PHPUnit should not force me to list the abstract base class (either in CoversClass or UsesClass) explicitly. That's an implementation detail that PHPUnit could implicitly assume.

@spriebsch spriebsch added the type/enhancement A new idea that should be implemented label Mar 10, 2024
@sebastianbergmann sebastianbergmann added feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/metadata Issues related to attributes and annotations labels Mar 10, 2024
@sebastianbergmann sebastianbergmann changed the title Implicit covers/uses for abstract base class Implicitly include (abstract) parent class with #[CoversClass] and #[UsesClass] attributes Mar 10, 2024
@sebastianbergmann sebastianbergmann self-assigned this Mar 13, 2024
@sebastianbergmann sebastianbergmann added this to the PHPUnit 11.1 milestone Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/code-coverage Issues related to code coverage (but not php-code-coverage) feature/metadata Issues related to attributes and annotations type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants