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

Covers annotations are not converted #44

Open
dshafik opened this issue May 9, 2024 · 0 comments
Open

Covers annotations are not converted #44

dshafik opened this issue May 9, 2024 · 0 comments

Comments

@dshafik
Copy link

dshafik commented May 9, 2024

If you use e.g. the #[CoversClass(Foo::class)] annotation, then it is not converted to a ->covers() chained call on the test. This means that if you have requireCoverageMetadata="true" in your phpunit.xml config, all tests will fail.

Input

#[CoversClass(Foo::class)]
class MyTest extends TestCase {
    public function testItDoesThing()
    {
        …
    }
}

Actual Output

test('it does thing', function () {
    …
});

And:

 WARN  Tests\Unit\MyTest
  ! it does thing → This test does not define a code coverage target but is expected to do so

Expected Output

test('it does thing', function () {
    …
})->covers(Foo::class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant