Page MenuHomePhabricator

Use @covers annotations in the class docblock for IPInfo tests
Closed, ResolvedPublic1 Estimated Story Points

Description

The PHPUnit @covers annotation is documented here: https://phpunit.readthedocs.io/en/9.5/annotations.html?highlight=%40covers#covers (see also @coversDefaultClass)

Most of the IPInfo tests use @covers in the test class docblock. A few tests use @covers on the individual tests.

From the documentation:

This annotation can be added to the docblock of the test class or the individual test methods. The recommended way is to add the annotation to the docblock of the test class, not to the docblock of the test methods.

Using @covers on the individual test methods can result in lower coverage being reported, and may need keeping up-to-date with refactors.

AC

All IPInfo PHPUnit tests use @covers only on the class docblock.

Event Timeline

Change 820106 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/IPInfo@master] Use @covers instead of @coversDefaultClass in logger tests

https://gerrit.wikimedia.org/r/820106

Change 820106 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Use @covers instead of @coversDefaultClass in logger tests

https://gerrit.wikimedia.org/r/820106

Prtksxna claimed this task.