Download the PHP package thor-juhasz/phpunit-coverage-check without Composer

On this page you can find all versions of the php package thor-juhasz/phpunit-coverage-check. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpunit-coverage-check

phpunit-coverage-check

CI workflow Coverage Status Scrutinizer Code Quality Build Status

GitHub license GitHub release

A PHPUnit test coverage checker.

This command will parse a clover.xml report file (generated by PHPUnit), to check that the test coverage meets a certain threshold (80% by default).

This library is loosely based on johanvanhelden's test coverage check.

Table of contents ## Table of contents - [Installation](#installation) - [Usage](#usage) * [Use in GitHub workflow](#use-in-github-workflow) * [Run manually](#run-manually) - [Arguments](#arguments) * [filename](#filename-required) - [Options](#options) * [threshold](#threshold-optional) * [metric](#metric-optional) * [suppress-errors](#suppress-errors-optional) - [Output](#output)

Installation

Run this in your projects root directory:

This will add a new PHP binary to your vendor/bin/ directory, named phpunit-coverage-check.

Usage

Use in GitHub workflow

To use this library in a GitHub CI workflow, make sure to generate a clover.xml report file when running phpunit:

Then simply add this after the step than runs phpunit:

Run manually

Generate a clover.xml report file with PHPUnit:

Then you can run the binary provided by this library, passing the name of the clover.xml file as the first argument:

Arguments

filename (required)

The filename of the clover coverage XML file.

Example:

Options

threshold (optional)

Default value: 80

The threshold determines the lower value of acceptable test coverage. You can pass your desired threshold using --threshold N or -t N for short, where N is a number ranging from 0 to 100:

Example:

metric (optional)

Default value: elements

You can specify here which metric you want to use to read the code coverage. The supported metrics are:

Example:

suppress-errors (optional)

When the code coverage reported in the clover XML report is under the specified threshold, the command will exit with code 1. When used in a CI workflow, this results in that job failing.

If you would like to use this tool in a CI workflow, without failing the job, you can pass the --suppress-errors option (or -s for short).

Example:

Output

Example outputs:


All versions of phpunit-coverage-check with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-bcmath Version *
ext-simplexml Version *
symfony/console Version 4.*|5.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thor-juhasz/phpunit-coverage-check contains the following files

Loading the files please wait ....