View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001069 | Xdebug | Uncategorized | public | 2014-08-14 06:55 | 2014-08-14 11:01 |
| Reporter | tarlabs | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | not fixable | ||
| Platform | Windows | OS | Win7 | OS Version | x64 |
| Product Version | 2.2.5 | ||||
| Summary | 0001069: Wrong coverage generated for single line if statements | ||||
| Description | I am using https://github.com/sebastianbergmann/php-code-coverage to generate code coverage report. This PHP code in background uses xDebug. I am going to open same bug on their issue list also, but I believe this is a xDebug bug only. | ||||
| Steps To Reproduce | To reproduce do the following: create a info.php page: <?php
?> Now call this page twice using below URLS http://localhost/info.php?abc=1 I have used below prepend file in my apache settings: $coverage = new PHP_CodeCoverage; $filter->addFileToBlacklist('c:/echo.php'); $coverage->start("test # " . rand(20, 200)); ?> and below append file <?php
?> The issue is that, if I have used a single line if, then i get code coverage xml as below <?xml version="1.0" encoding="UTF-8"?> For both URLs, which is anyways wrong as Once I get inside If and then inside else. But if I modify the code as below <?php
?> Then the coverage report comes fine <?xml version="1.0" encoding="UTF-8"?> Let me know if you need any further information | ||||
| Additional Information | PHP version PHP 5.5.12 (cli) (built: Apr 30 2014 11:20:55) | ||||
| Tags | No tags attached. | ||||
| Operating System | |||||
| PHP Version | 5.5.5-5.5.9 | ||||