Page MenuHomePhabricator

Use @covers annotations in the class docblock for SimilarEditors tests
Open, Needs TriagePublic1 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 SimilarEditors 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 SimilarEditors PHPUnit tests use @covers only on the class docblock.

Event Timeline

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

[mediawiki/extensions/SimilarEditors@master] Move @covers annotations to the test class dockblock

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

Change 820762 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Move @covers annotations to the test class dockblock

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