{"id":24350129,"url":"https://github.com/oradwell/covers-validator","last_synced_at":"2025-04-09T21:43:50.996Z","repository":{"id":1865505,"uuid":"44777548","full_name":"oradwell/covers-validator","owner":"oradwell","description":"Validates covers tags in PHPUnit tests","archived":false,"fork":false,"pushed_at":"2022-10-04T20:01:58.000Z","size":109,"stargazers_count":21,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T12:41:23.517Z","etag":null,"topics":["coverage","php","php7","phpunit","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oradwell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-22T22:43:27.000Z","updated_at":"2022-09-30T18:25:08.000Z","dependencies_parsed_at":"2022-08-08T14:30:13.558Z","dependency_job_id":null,"html_url":"https://github.com/oradwell/covers-validator","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oradwell%2Fcovers-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oradwell%2Fcovers-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oradwell%2Fcovers-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oradwell%2Fcovers-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oradwell","download_url":"https://codeload.github.com/oradwell/covers-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119353,"owners_count":21050754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","php","php7","phpunit","testing"],"created_at":"2025-01-18T13:27:06.624Z","updated_at":"2025-04-09T21:43:50.968Z","avatar_url":"https://github.com/oradwell.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ockcyp/covers-validator\n=======================\n\n[![Build Status](https://api.travis-ci.com/oradwell/covers-validator.svg?branch=master)](https://app.travis-ci.com/github/oradwell/covers-validator)\n[![Coverage Status](https://coveralls.io/repos/github/oradwell/covers-validator/badge.svg?branch=master)](https://coveralls.io/github/oradwell/covers-validator?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/oradwell/covers-validator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/oradwell/covers-validator/?branch=master)\n[![License](https://poser.pugx.org/ockcyp/covers-validator/license)](https://packagist.org/packages/ockcyp/covers-validator)\n[![Total Downloads](https://poser.pugx.org/ockcyp/covers-validator/downloads)](https://packagist.org/packages/ockcyp/covers-validator)\n\nPHPUnit @covers tags validator\n\n[PHPUnit](https://github.com/sebastianbergmann/phpunit) fails to generate coverage report\nwhen tests have invalid [@covers](https://phpunit.de/manual/6.0/en/appendixes.annotations.html#appendixes.annotations.covers)\ntags.\n\nThis tool allows you to determine the tests that have invalid @covers tags\nwithout you needing to run the coverage.\n\nUsually coverage reports are run less often than the tests as it takes\na long time to run. This tool validates your @covers tags\nquicker than you run your tests.\n\n**Also see:** [dunkelfrosch/phpcoverfish](https://github.com/dunkelfrosch/phpcoverfish)\n\nWhy?\n----\n\n```\nTrying to @cover or @use not existing class or interface \"NonExistentClass\".\nTrying to @cover or @use not existing method \"ExistingClass::nonExistantMethod\".\n```\n\nSee: [phpunit/issues/1758](https://github.com/sebastianbergmann/phpunit/issues/1758)\u003cbr /\u003e\nAlso see: [phpunit/issues/1791](https://github.com/sebastianbergmann/phpunit/issues/1791)\n\nInstallation\n------------\n\n```\ncomposer require --dev ockcyp/covers-validator\n```\n\n### PHPUnit versions\n\nLatest version of covers-validator supports PHP 7.1+ and PHPUnit 7+.\nPlease use version 0.5 for older PHP and PHPUnit versions.\n\n| PHPUnit version | Covers-validator version |\n| --------------- | ------------------------ |\n| \u003c 6.0           | 0.5.x                    |\n| \u003e= 6.0          | 1.x                      |\n\nInstall using the following for version 0.5:\n\n```\ncomposer require --dev ockcyp/covers-validator \"^0.5\"\n```\n\nUsage\n-----\n\n```\nvendor/bin/covers-validator\n```\n\nGive optional `-c` argument to load a particular PHPUnit configuration file:\n\n```\nvendor/bin/covers-validator -c tests/Fixtures/configuration.xml\n```\n\nOverride `bootstrap` specified in PHPUnit configuration:\n\n```\nvendor/bin/covers-validator --bootstrap tests/bootstrap.php\n```\n\nDisable output by providing `-q` argument\n\n```\nvendor/bin/covers-validator -q\n```\n\nAdjust the verbosity:\n\n| Verbosity | Shows                               |\n| --------- | ----------------------------------- |\n| -v        | Valid tests                         |\n| -vv       | Loaded configuration file           |\n| -vvv      | Test name before validation is done |\n\n### Sample output\n\n#### Normal verbosity\n\n```\nInvalid - OckCyp\\CoversValidator\\Tests\\Fixtures\\TwoTestCoveringNonExistentClassTest::testDummyTest\n\nThere were 1 test(s) with invalid @covers tags.\n```\n\n#### Maximum verbosity (debug)\n\n```\nConfiguration file loaded: /home/omer/Projects/Personal/covers-validator/tests/Fixtures/configuration-all.xml\n\nValidating OckCyp\\CoversValidator\\Tests\\Fixtures\\TwoTestCoveringExistingClassTest::testDummyTest...\nValid - OckCyp\\CoversValidator\\Tests\\Fixtures\\TwoTestCoveringExistingClassTest::testDummyTest\nValidating OckCyp\\CoversValidator\\Tests\\Fixtures\\TwoTestCoveringNonExistentClassTest::testDummyTest...\nInvalid - OckCyp\\CoversValidator\\Tests\\Fixtures\\TwoTestCoveringNonExistentClassTest::testDummyTest\n\nThere were 1 test(s) with invalid @covers tags.\n```\n\n**Tip:** Command gives exit code 1 when any of the covers tags are invalid.\nUse this to fail your builds.\n\nTests\n-----\n\nTo run the tests, execute:\n\n```\nvendor/bin/phpunit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foradwell%2Fcovers-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foradwell%2Fcovers-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foradwell%2Fcovers-validator/lists"}