1

I want to generate phpunit code coverage on my own, but so far it wasnt succeed. From here: https://gist.github.com/christeredvartsen/5128598 with this code:

<?php
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

// other codes

$data = xdebug_get_code_coverage();
xdebug_stop_code_coverage();
$coverage = new PHP_CodeCoverage();
$coverage->append($data, 'some-id');
$report = new PHP_CodeCoverage_Report_HTML();
$report->process($coverage, '/tmp/coverage-report');

it wont generate anything but a Total 100.00% covered (success) line. Even though my whole project is covered and run.

0

1 Answer 1

1

okay, Im figured out myself. Instead of:

$coverage->append($data, 'some-id');

use

$coverage->setData($data, 'some-id');

!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.