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

#[UsesInterface] attribute #5734

Open
spriebsch opened this issue Mar 10, 2024 · 0 comments
Open

#[UsesInterface] attribute #5734

spriebsch opened this issue Mar 10, 2024 · 0 comments
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

Comments

@spriebsch
Copy link

Code regularly depends on interfaces, e.g. when working with a collaborator. In the spirit of loose coupling, it should not really matter which implementation of an interface I'm using in a test.

Currently, however, I have to explicitly list the used implementation of an interface by a UsesClass annotation.

I am proposing a new annotation, namely UsesInterface. With this, I specify that the tested code unit depdends upon/uses an implementation of said interface. For the Uses part, we don't care too much which one that is, thus I should not be forced to list production code or hand-crafted stubs explicitly.

@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 New Annotation: UsesInterface #[UsesInterface] attribute Mar 10, 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