All Projects → oradwell → covers-validator

oradwell / covers-validator

Licence: MIT license
Validates covers tags in PHPUnit tests

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to covers-validator

laravel-survey
Laravel 6 survey app.
Stars: ✭ 39 (+85.71%)
Mutual labels:  coverage, phpunit
phpunit-travis-ci-coverage-example
phpUnit Testing on Travis-CI with Code Coverage on CodeCov
Stars: ✭ 30 (+42.86%)
Mutual labels:  coverage, phpunit
Coveragechecker
Allows old code to use new standards
Stars: ✭ 159 (+657.14%)
Mutual labels:  coverage, phpunit
wordpress-plugin
WordPress plugin starter template with all of the things.
Stars: ✭ 19 (-9.52%)
Mutual labels:  phpunit
PHPUnit-Polyfills
Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
Stars: ✭ 147 (+600%)
Mutual labels:  phpunit
php-toolbox
🐳 A Docker image designed for PHP developers that care about code quality.
Stars: ✭ 18 (-14.29%)
Mutual labels:  phpunit
react-testing-mocha-chai-enzyme
A solid test setup for React components with Mocha, Chai, Sinon, Enzyme in a Webpack/Babel application.
Stars: ✭ 48 (+128.57%)
Mutual labels:  coverage
librarify-back
Librarify. Creando una API con Symfony 5 es un curso completo sobre Symfony 5 en el que cuento cómo desarrollar una API desde cero empleando FOS Rest Bundle.
Stars: ✭ 30 (+42.86%)
Mutual labels:  phpunit
ghaction-cmake
cmake swiss army knife github docker action
Stars: ✭ 19 (-9.52%)
Mutual labels:  coverage
codeclimate-action
GitHub Action to send your code coverage to CodeClimate
Stars: ✭ 145 (+590.48%)
Mutual labels:  coverage
phpunit-injector
Injects services from a PSR-11 dependency injection container to PHPUnit test cases
Stars: ✭ 62 (+195.24%)
Mutual labels:  phpunit
floss
Unit-testing for those hard to reach places
Stars: ✭ 26 (+23.81%)
Mutual labels:  coverage
phpunit-util
Helper package to ease testing with PHPUnit.
Stars: ✭ 18 (-14.29%)
Mutual labels:  phpunit
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (+80.95%)
Mutual labels:  coverage
example-objc
Codecov example for Xcode
Stars: ✭ 24 (+14.29%)
Mutual labels:  coverage
OGMNeo
[No Maintenance] Neo4j nodeJS OGM(object-graph mapping) abstraction layer
Stars: ✭ 54 (+157.14%)
Mutual labels:  coverage
laravel-test-watcher
Laravel Test Watcher
Stars: ✭ 20 (-4.76%)
Mutual labels:  phpunit
jest-badges-readme
Creates a group of coverage badges from Jest into your README
Stars: ✭ 30 (+42.86%)
Mutual labels:  coverage
toaster
Incremental failure injection in C
Stars: ✭ 15 (-28.57%)
Mutual labels:  coverage
phpunit-documentation-chinese
Simplified Chinese Documentation for PHPUnit
Stars: ✭ 35 (+66.67%)
Mutual labels:  phpunit

ockcyp/covers-validator

Build Status Coverage Status Scrutinizer Code Quality License Total Downloads

PHPUnit @covers tags validator

PHPUnit fails to generate coverage report when tests have invalid @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 it takes a long time to run. This tool validates your @covers tags quicker than you run your tests.

Also see: dunkelfrosch/phpcoverfish

Why?

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
Also see: phpunit/issues/1791

Installation

composer require --dev ockcyp/covers-validator

PHPUnit versions

Latest version of covers-validator supports PHP 7.1+ and PHPUnit 7+. Please use version 0.5 for older PHP and PHPUnit versions.

PHPUnit version Covers-validator version
< 6.0 0.5.x
>= 6.0 1.x

Install using the following for version 0.5:

composer require --dev ockcyp/covers-validator "^0.5"

Usage

vendor/bin/covers-validator

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

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

Override bootstrap specified in PHPUnit configuration:

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

Disable output by providing -q argument

vendor/bin/covers-validator -q

Adjust the verbosity:

Verbosity Shows
-v Valid tests
-vv Loaded configuration file
-vvv Test name before validation is done

Sample output

Normal verbosity

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

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

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.

Tip: Command gives exit code 1 when any of the covers tags are invalid. Use this to fail your builds.

Tests

To run the tests, execute:

vendor/bin/phpunit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].