PHP code example of matthiasnoback / live-code-coverage
1. Go to this page and download the library: Download matthiasnoback/live-code-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/ */
matthiasnoback / live-code-coverage example snippets
use LiveCodeCoverage\LiveCodeCoverage;
$shutDownCodeCoverage = LiveCodeCoverage::bootstrap(
(bool)getenv('CODE_COVERAGE_ENABLED'),
__DIR__ . '/../var/coverage',
__DIR__ . '/../phpunit.xml.dist'
);
// Run your web application now...
// This will save and store collected coverage data:
$shutDownCodeCoverage();
$shutDownCodeCoverage = LiveCodeCoverage::bootstrap(
// ...
);
register_shutdown_function($shutDownCodeCoverage);
// Run your web application now...