View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000440 | Xdebug | Code Coverage | public | 2009-05-11 21:31 | 2020-03-12 17:35 |
Reporter | danielpr | Assigned To | derick | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Summary | 0000440: Difference in code-coverage of class-declaration | ||||
Description | We've experienced a bug in PHPUnit, which sometimes marks a class-declaration as executable code and says, reports this code as not covered: So i narrowed it down to the behaviour of XDebug. The executable lines output shows a difference depending if a file is loaded before or after the xdebug_start_code_coverage. | ||||
Additional Information | Class1.php:
} Class2.php (same as Class1 except the class-declaration :) ):
} Test Script: require 'Class2.php'; print_r(xdebug_get_code_coverage()); RESULT: | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 5.2.8 | ||||
|
This is not a bug. Xdebug can only scans items (files, functions, methods) when they are loaded and code coverage is enabled. The class file is loaded before code coverage is enabled, and is therefore not picked up in the coverage report. The methods are scanned when they are run as well, so it works there. |
Date Modified | Username | Field | Change |
---|---|---|---|
2009-05-11 21:31 | danielpr | New Issue | |
2009-05-11 21:31 | danielpr | PHP Version | => 5.2.8 |
2009-05-11 21:31 | danielpr | Xdebug Version | => 2.0.4-dev |
2009-10-17 17:54 | derick | Note Added: 0001102 | |
2009-10-17 17:54 | derick | Status | new => resolved |
2009-10-17 17:54 | derick | Resolution | open => no change required |
2009-10-17 17:54 | derick | Assigned To | => derick |
2020-03-12 16:55 | derick | Severity | major => feature |
2020-03-12 17:35 | derick | Category | Feature/Change request => Code Coverage |