View Issue Details

IDProjectCategoryView StatusLast Update
0000201XdebugCode Coveragepublic2020-03-12 17:13
Reportersebastian Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionno change required 
Summary0000201: Include files with no executed line of code in code coverage
Description

sb@wopr-mobile ~ % cat Foo.php
<?php
class Foo {
public function bar()
{
}
}
?>
sb@wopr-mobile ~ % cat test.php
<?php
require_once 'Foo.php';

xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);

$cc = xdebug_get_code_coverage();
xdebug_stop_code_coverage();

print_r($cc);
?>
sb@wopr-mobile ~ % php test.php
Array
(
[/home/sb/test.php] => Array
(
[6] => 1
)

)

TagsNo tags attached.
Operating SystemIrrelevant
PHP Version5.1-dev

Activities

derick

2006-09-27 08:03

administrator   ~0000458

You should require the file after you start code coverage, like this:

<?php
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
require_once 'Foo.php';

Issue History

Date Modified Username Field Change
2006-09-26 22:42 sebastian New Issue
2006-09-27 08:03 derick Status new => resolved
2006-09-27 08:03 derick Resolution open => no change required
2006-09-27 08:03 derick Assigned To => derick
2006-09-27 08:03 derick Note Added: 0000458
2020-03-12 16:56 derick Severity trivial => feature
2020-03-12 17:13 derick Category Feature/Change request => Code Coverage