Download the PHP package esi/phpunit-coverage-check without Composer

On this page you can find all versions of the php package esi/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

Build Status Code Coverage Scrutinizer Code Quality Continuous Integration SymfonyInsight Type Coverage Psalm Level Quality Gate Status Latest Stable Version Downloads per Month License

PHPUnit Coverage Check - Check the code coverage using the clover report of PHPUnit.

This library will read the clover (or openclover in PHPUnit 12.2+) XML report from PHPUnit and calculate the coverage score. Based on the given threshold, the application will exit OK if the coverage is higher than the threshold or exit with code 1 if the coverage is lower than the threshold.

This library can be used in multiple ways:

See Usage for more information.

[!IMPORTANT] This project is not in any way an official PHPUnit project. Meaning it is not associated with, or endorsed by, the PHPUnit project or its author Sebastian Bergmann.

GitHub Action

A GitHub action is available and can be found in the PHPUnit Coverage Check Action repository, or on the GitHub Marketplace.

Installation

Composer

PHPUnit Coverage Check can be installed using Composer. Add this repository as a dev-dependency to the composer.json file.

To use PHPUnit Coverage Check on an older version of PHP:

Phar

Download the phpunit-coverage-check.phar from an available release. It is recommended to check the signature when downloading the Phar from a GitHub Release (with phpunit-coverage-check.phar.asc).

The Phar files of PHPUnit Coverage Check are signed with a public key associated to [email protected].. The key(s) associated with this E-Mail address can be queried at keys.openpgp.org.

Install with Phive

You can also install the PHPUnit Coverage Check Phar with Phive.

If not already using Phive, you can read more about it here, also Phive installation and usage.

Usage

There are two parameters that must be passed to return the code coverage.

  1. The location of the clover XML file that PHPUnit has generated.
  2. The coverage threshold that is acceptable or 'passing.' Min = 1, Max = 100.

Generate the clover.xml file by using PHPUnit:

Prior to PHPUnit 12.2 (or if you prefer the old clover format of PHPUnit)

You can also add the coverage report generation to your PHPUnit configuration file (phpunit.xml.dist for example). You would need to add the following lines inside the <coverage> tag:

PHPUnit 12.2 and later, for OpenClover

For the experimental OpenClover report in PHPUnit 12.2+

If installed with Composer

You can use the Api directly if you wish. The Esi\CoverageCheck\CoverageCheck::nonConsoleCall() method will process and return the data, like how the console application displays it.

An example usage:

If using the Phar

With --only-percentage (or -O) enabled, the CLI command will only return the resulting coverage percentage.

--show-files

With --show-files (or -F), --only-percentage will be ignored. This option parses the clover file for coverage information for each file in the project/package, determine coverage, and display the information in a table.

For example:

Passing coverage example output
Mixed pass/fail coverage example output

--table-width

The --table-width (or -W) option will only have an affect if used with the --show-files option. The only requirement for this particular option is that you must pass an integer value. For example:

About

Requirements

Credits

This library is a fork of/based upon rregeer/phpunit-coverage-check by Richard Regeer.

Most of this library has been rewritten from the ground up, to replace and improve the majority of the original library. The overall idea, and key pieces of the calculation, are thanks to the original library. Many thanks and much appreciation to Richard Regeer for his wonderful work.

Contributing

See CONTRIBUTING.

Bugs and feature requests are tracked on GitHub.

Contributor Covenant Code of Conduct

See CODE_OF_CONDUCT.md

Backward Compatibility Promise

See backward-compatibility.md for more information on Backwards Compatibility.

Changelog

See the CHANGELOG for more information on what has changed recently.

License

See the LICENSE for more information on the license that applies to this project.

Security

See SECURITY for more information on the security disclosure process.


All versions of phpunit-coverage-check with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-libxml Version *
ext-simplexml Version *
symfony/console Version ~7.3.10
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 esi/phpunit-coverage-check contains the following files

Loading the files please wait ...