PHP code example of league / phpunit-coverage-listener
1. Go to this page and download the library: Download league/phpunit-coverage-listener 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/ */
league / phpunit-coverage-listener example snippets
public function beforeCollect(Collection $data)
{
// Check for Travis-CI environment
// if it appears, then assign it respectively
if (getenv('TRAVIS_JOB_ID') || isset($_ENV['TRAVIS_JOB_ID'])) {
// Remove repo token
$data->remove('repo_token');
// And use travis config
$travis_job_id = isset($_ENV['TRAVIS_JOB_ID']) ? $_ENV['TRAVIS_JOB_ID'] : getenv('TRAVIS_JOB_ID');
$data->set('service_name', 'travis-ci');
$data->set('service_job_id', $travis_job_id);
}
return $data;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.