Skip to content

Allow usage of CoversNothing on test class method when test class has Covers* attribute without warning #6235

Open
@jnoordsij

Description

@jnoordsij

With #6170 a warning was added, that will warn if a test combines CoversNothing and Covers* on a target, as it may suggest improper attribute usage by the user.

However, I think there is still a potentially valid case where this may happen:

  • have a test class with a Covers* attribute applied to it
  • have a test method within the class with the CoversNothing to 'override' the class-level attribute declaration

For my use-case, I combine these in tests where I'm testing one single class, but have some sanity-like test not related directly to code execution of this class. This is mainly just a nice way of adding some metadata, but I can think of similar examples where this may be even more viable. Therefore I've opted to create this issue to gather some feedback and perhaps traction of people with similar appliances to see if changing this is viable.

Note there may be more target combinations that could potentially be considered valid cases of combining these two attributes (or others) in some way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature/code-coverageIssues related to code coverage (but not php-code-coverage)type/enhancementA new idea that should be implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions