Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xp-forge/coverage
Code coverage for XP Framework unittests
https://github.com/xp-forge/coverage
coverage coverage-report php7 php8 phpunit unittest xdebug xp-framework
Last synced: 27 days ago
JSON representation
Code coverage for XP Framework unittests
- Host: GitHub
- URL: https://github.com/xp-forge/coverage
- Owner: xp-forge
- Created: 2018-09-14T13:29:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T21:01:33.000Z (over 3 years ago)
- Last Synced: 2024-11-13T21:47:58.107Z (2 months ago)
- Topics: coverage, coverage-report, php7, php8, phpunit, unittest, xdebug, xp-framework
- Language: PHP
- Homepage:
- Size: 87.9 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
Code coverage for XP Framework unittests
========================================================================[![Build status on GitHub](https://github.com/xp-forge/coverage/workflows/Tests/badge.svg)](https://github.com/xp-forge/coverage/actions)
[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)
[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)
[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)
[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)
[![Latest Stable Version](https://poser.pugx.org/xp-forge/coverage/version.png)](https://packagist.org/packages/xp-forge/coverage)Code coverage for XP using XDebug. Based on Sebastian Bergmann's [Code coverage](https://github.com/sebastianbergmann/php-code-coverage) library.
Installation
------------```bash
$ composer global require xp-forge/coverage
```Next, make sure you have the [XDebug Zend extension](https://xdebug.org/download.php) loaded via `zend_extension`.
Usage
-----```bash
$ xp coverage -p src/main/php/unittest/ src/test/php
[.....................]♥: 21/21 run (0 skipped), 21 succeeded, 0 failed
Memory used: 3839.68 kB (4050.93 kB peak)
Time taken: 0.246 seconds
Coverage: 84.72% lines covered (61/72)┌──────────────────────────────────────────────────────┬─────────┬──────┐
│ Class │ % Lines │ Not │
╞══════════════════════════════════════════════════════╪═════════╪══════╡
│ unittest.coverage.ClassName │ 100.00% │ │
│ unittest.coverage.CoverageDetails │ 100.00% │ │
│ unittest.coverage.CoverageListener │ 60.71% │ 11 │
└──────────────────────────────────────────────────────┴─────────┴──────┘
```### HTML Report
An optional HTML report can be generated like this.
```bash
$ xp coverage -p src/main/php -r ./coverage-report src/test/php/
```Use it in order to find out how to improve your coverage.
### Clover report
A [clover](https://www.atlassian.com/software/clover) report can be generated as well.
```bash
$ xp coverage -p src/main/php -c clover.xml src/test/php/
```