PHPackages                             ockcyp/covers-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ockcyp/covers-validator

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ockcyp/covers-validator
=======================

Validates @covers tags in PHPUnit tests

v1.7.0(7mo ago)21198.0k↑16%9[1 issues](https://github.com/oradwell/covers-validator/issues)20MITPHPPHP ^7.1 || ^8.0CI passing

Since Oct 28Pushed 7mo ago3 watchersCompare

[ Source](https://github.com/oradwell/covers-validator)[ Packagist](https://packagist.org/packages/ockcyp/covers-validator)[ RSS](/packages/ockcyp-covers-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (26)Used By (20)

covers-validator
================

[](#covers-validator)

[![CI](https://github.com/oradwell/covers-validator/actions/workflows/ci.yaml/badge.svg)](https://github.com/oradwell/covers-validator/actions/workflows/ci.yaml)[![Coverage Status](https://camo.githubusercontent.com/c823be0806f07f9752f4c2996dc1ca8d2f816cfcf3afaaf0abb5572d749803d0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f72616477656c6c2f636f766572732d76616c696461746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/oradwell/covers-validator?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2f16018e39e72794d5ba839b4aee8001b141f9e4af295ed5fd2ff4e14703bd88/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f72616477656c6c2f636f766572732d76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/oradwell/covers-validator/?branch=master)[![License](https://camo.githubusercontent.com/2071190789bed7a22f92eaffef5409a766d974e1fa89d0e09044a2666c1950c7/68747470733a2f2f706f7365722e707567782e6f72672f6f636b6379702f636f766572732d76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/ockcyp/covers-validator)[![Total Downloads](https://camo.githubusercontent.com/063f2b88bd126bd291c7311819b7b0f7c8bd51eb3fbf385b192ae24bbda66476/68747470733a2f2f706f7365722e707567782e6f72672f6f636b6379702f636f766572732d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/ockcyp/covers-validator)

PHPUnit @covers tags validator

Why?
----

[](#why)

[PHPUnit](https://github.com/sebastianbergmann/phpunit) fails to generate a coverage report when tests have invalid [@covers](https://docs.phpunit.de/en/10.5/annotations.html#covers)tags.

This tool allows you to determine the tests that have invalid @covers tags without you needing to run the coverage.

Usually coverage reports are run less often than the tests as they take a long time to run. This tool validates your @covers tags quicker than you run your tests.

```
Trying to @cover or @use not existing class or interface "NonExistentClass".
Trying to @cover or @use not existing method "ExistingClass::nonExistantMethod".

```

See: [phpunit/issues/1758](https://github.com/sebastianbergmann/phpunit/issues/1758)
Also see: [phpunit/issues/1791](https://github.com/sebastianbergmann/phpunit/issues/1791)

Abandoned alternative: [dunkelfrosch/phpcoverfish](https://github.com/dunkelfrosch/phpcoverfish)

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

- PHP 7.1+
- PHPUnit 7.0+

### Installation

[](#installation)

#### Composer

[](#composer)

Recommended way of installing covers-validator is via [Composer](https://get.org/).

```
composer require --dev ockcyp/covers-validator
```

#### Phar

[](#phar)

Download the `covers-validator.phar` asset from the [latest release](https://github.com/oradwell/covers-validator/releases/latest)or any other release from the [releases](https://github.com/oradwell/covers-validator/releases).

Then run using the following:

```
php covers-validator.phar
```

Note

The usage documentation assumes you installed covers-validator using Composer, so please replace any reference to "vendor/bin/covers-validator" with "php covers-validator.phar".

Note

Only releases since v0.3.0 can be used as a phar.

#### Older versions

[](#older-versions)

Latest release of covers-validator supports PHP 7.1+ and PHPUnit 7+. Please use a previous release with older PHP and PHPUnit versions.

PHPUnit versionCovers-validator release&lt; 6.00.5.x6.0 - 9.x1.57.0 - 9.x1.67.0 - 10.x&gt;= 1.7.0### Usage

[](#usage)

Run the validator using the following:

```
vendor/bin/covers-validator
```

Tip

The command returns exit code 1 when any of the covers tags are invalid. Use this to fail your builds.

#### Override configuration file

[](#override-configuration-file)

Give optional `-c` argument to load a particular PHPUnit configuration file:

```
vendor/bin/covers-validator -c tests/Fixtures/configuration.xml
```

#### Override PHPUnit bootstrap

[](#override-phpunit-bootstrap)

Override the `bootstrap` value specified in PHPUnit configuration:

```
vendor/bin/covers-validator --bootstrap tests/bootstrap.php
```

#### Disable output

[](#disable-output)

Disable output by providing the `-q` argument

```
vendor/bin/covers-validator -q
```

Adjust the verbosity:

VerbosityShows`-v`Valid tests`-vv`Loaded configuration file`-vvv`Test name before validation is done### Sample output

[](#sample-output)

#### Normal verbosity

[](#normal-verbosity)

```
Invalid - OckCyp\CoversValidator\Tests\Fixtures\TwoTestCoveringNonExistentClassTest::testDummyTest

There were 1 test(s) with invalid @covers tags.

```

#### Maximum verbosity (debug)

[](#maximum-verbosity-debug)

```
Configuration file loaded: /home/omer/Projects/Personal/covers-validator/tests/Fixtures/configuration-all.xml

Validating OckCyp\CoversValidator\Tests\Fixtures\TwoTestCoveringExistingClassTest::testDummyTest...
Valid - OckCyp\CoversValidator\Tests\Fixtures\TwoTestCoveringExistingClassTest::testDummyTest
Validating OckCyp\CoversValidator\Tests\Fixtures\TwoTestCoveringNonExistentClassTest::testDummyTest...
Invalid - OckCyp\CoversValidator\Tests\Fixtures\TwoTestCoveringNonExistentClassTest::testDummyTest

There were 1 test(s) with invalid @covers tags.

```

Tests
-----

[](#tests)

To run the tests, execute:

```
vendor/bin/phpunit
```

Versioning
----------

[](#versioning)

We use [Semantic Versioning](https://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/oradwell/covers-validator/releases) or the [CHANGELOG.md](./CHANGELOG.md) file.

Authors
-------

[](#authors)

- Oliver Radwell - [@oradwell](https://github.com/oradwell)

See also the list of [contributors](https://github.com/oradwell/covers-validator/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.txt](./LICENSE.txt) file for details.

Acknowledgments
---------------

[](#acknowledgments)

- [Sebastian Bergmann](https://github.com/sebastianbergmann) for creating the [PHPUnit](https://phpunit.de/) project
- The [contributors](https://github.com/oradwell/covers-validator/graphs/contributors)

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance62

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 86.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~151 days

Recently: every ~439 days

Total

25

Last Release

224d ago

Major Versions

v0.5.2 → v1.0.02018-05-08

0.5.x-dev → v1.1.02019-03-15

PHP version history (4 changes)v0.1.0PHP ^5.3.0 || ^7.0

v0.6.0PHP ^7.0

v1.3.1PHP ^7.0 || ^8.0

v1.6.0PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e696afe1a24280bbde4071ff886394ee586eb9a33d11df0957f1c0c9cd8fd7a4?d=identicon)[ockcyp](/maintainers/ockcyp)

---

Top Contributors

[![oradwell](https://avatars.githubusercontent.com/u/5054896?v=4)](https://github.com/oradwell "oradwell (93 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (5 commits)")[![gbirke](https://avatars.githubusercontent.com/u/223326?v=4)](https://github.com/gbirke "gbirke (2 commits)")[![Krinkle](https://avatars.githubusercontent.com/u/156867?v=4)](https://github.com/Krinkle "Krinkle (2 commits)")[![theofidry](https://avatars.githubusercontent.com/u/5175937?v=4)](https://github.com/theofidry "theofidry (2 commits)")[![mattstauffer](https://avatars.githubusercontent.com/u/151829?v=4)](https://github.com/mattstauffer "mattstauffer (1 commits)")[![jochen42](https://avatars.githubusercontent.com/u/617145?v=4)](https://github.com/jochen42 "jochen42 (1 commits)")[![smoench](https://avatars.githubusercontent.com/u/183530?v=4)](https://github.com/smoench "smoench (1 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (1 commits)")

---

Tags

coveragephpphp7php8phpunittestingtestingphpunitcoverage

### Embed Badge

![Health badge](/badges/ockcyp-covers-validator/health.svg)

```
[![Health](https://phpackages.com/badges/ockcyp-covers-validator/health.svg)](https://phpackages.com/packages/ockcyp-covers-validator)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[facile-it/paraunit

paraunit

146721.6k11](/packages/facile-it-paraunit)[lmc/steward

Steward - makes Selenium WebDriver + PHPUnit testing easy and robust

222163.1k1](/packages/lmc-steward)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k34](/packages/robiningelbrecht-phpunit-coverage-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
