PHP code example of xp-forge / coverage
1. Go to this page and download the library: Download xp-forge/coverage library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xp-forge / coverage example snippets
bash
$ composer global
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 │
└──────────────────────────────────────────────────────┴─────────┴──────┘