[xdebug-dev] Bug 0000201: Include files with no executed line of code in code coverage

From: <xdebug-dev[@]lists.xdebug.org>
Date: Wed, 27 Sep 2006 09:03:07 +0200

The following bug has been RESOLVED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000201
======================================================================
Reporter: sebastian
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 201
Category: Feature/Change request
Reproducibility: always
Severity: trivial
Priority: normal
Status: resolved
Operating System: Irrelevant
PHP Version: 5.1-dev
Xdebug Version: 2.0.0rc1-dev
Resolution: not a bug
======================================================================
Date Submitted: 2006-09-26 23:42 CEST
Last Modified: 2006-09-27 09:03 CEST
======================================================================
Summary: 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
        )

)

======================================================================

----------------------------------------------------------------------
 derick - 2006-09-27 09:03 CEST
----------------------------------------------------------------------
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';

Bug History
Date Modified Username Field Change
======================================================================
2006-09-26 23:42sebastian New Bug
2006-09-26 23:42sebastian Bug Monitored: sebastian
2006-09-27 09:03derick Status new => resolved
2006-09-27 09:03derick Bugnote Added: 0000458
2006-09-27 09:03derick Assigned To => derick
2006-09-27 09:03derick Resolution open => not a bug
======================================================================
Received on Wed Sep 27 2006 - 09:03:13 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST