View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001224 | Xdebug | public | 2015-12-07 08:04 | 2016-02-11 18:40 | |
Reporter | samsonasik | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
OS | Mac OS | OS Version | 10.11 | ||
Product Version | 2.4.0rc2 | ||||
Summary | 0001224: phpunit coverage with php7 and 2.4.0RC3-dev coverage always 100% | ||||
Description | it happen only in php7 with xdebug 2.4.0RC3-dev, when I run phunit, the oncovered functions/untested function marked as covered/green. | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Operating System | |||||
PHP Version | 7.0-dev | ||||
|
I tested in phpunit 4 and phpunit 5, the coverage always 100% even only "__construct" tested. Other methods marked as green in bar, but blank white in code line. |
|
I don't know how to reproduce this... can you give detailed and complete instructions so that I can run it at home (without having to setup anything)? |
|
seems I can't reproduce in sample source now, but in real app, it looks something like this ( please see attached image) in php7, white in source and green in bar, while in php 5.6, it red. Thanks. |
|
Sorry - but I really need a reproducible case. I can't guess what's wrong from this description. |
|
I dug more on this, found that @runInSeparateProcess make it works, but wondering why it needed while in php 5.6, it works without @runInSeparateProcess |
|
I've gotten reproduce-able case for it, I tried mock SplFileObject in one of my test: $this->getMock(\SplFileObject::class, [], ['php://memory']); Interestingly, this issue is only happen in php7. It may related with phpunit itself. |
|
I'm experiencing the same issue with PHP 7.0.0 and Xdebug v2.4.0RC3. Here are the steps to reproduce:
Click on UuidBinaryType.php and look at around lines 50-52, which should look like this:
These lines are not covered by the tests, but there is no indication in the code coverage report that they aren't covered, and the report shows 100% of the lines covered. I expect to see these lines displayed in red in the report, and I expect the percentage covered to be less than 100%. When I run these same commands in PHP 5.6.16 with Xdebug v2.4.0RC3, then I see these same lines colored in red, and the file shows 88.46% of the lines covered. |
|
Ramsey, the cloned code doesn't match your comments. Line 50-52 are: 50 And the lines with length 16 are now: 41 public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) Line 43 and 45 show as covered. Can you check again? |
|
Samsoniak, a reproducible case is something I can download and run. If it's just a one liner, it's not going to be useful to me. What Ramsey did is. Can you do something similar? |
|
Sorry about that, Derick. I've made changes to the library, so my bug report is now out of date. To get to the exact same reproducible state I mentioned above, use commit abbcbe56b023319dea7a72177333089cf47f5a69. Steps: git clone https://github.com/ramsey/uuid-doctrine.git Now, look at lines 50-52 on UuidBinaryType.php. I expect these to be in red, as they were not covered. Instead, they are neither green nor red, and the coverage report shows 100% coverage. |
|
I'm sorry derick, I can't give reproduceable case that can be shown publicly for now... hopefully what ramsey did above is same with my case. Thank you. |
|
This does not seem to be a bug in Xdebug. When debugging Ramsey's code, and outputting (by modifying phpunit's code) the result of each xdebug_get_code_coverage(), there is in the output: <code> Which is the right result. For some reason, phpunit code coverage simply chooses not to show the information. samsonasik, I obviously can't debug your code, but let's assume it's the same issue. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-12-07 08:04 | samsonasik | New Issue | |
2015-12-09 23:50 | samsonasik | Note Added: 0003309 | |
2015-12-10 14:53 | derick | Note Added: 0003311 | |
2015-12-10 14:53 | derick | Assigned To | => derick |
2015-12-10 14:53 | derick | Status | new => feedback |
2015-12-10 14:53 | derick | Product Version | 2.4.0beta1 => 2.4.0rc2 |
2015-12-11 15:51 | samsonasik | File Added: rep.png | |
2015-12-11 15:51 | samsonasik | File Added: green.png | |
2015-12-11 15:52 | samsonasik | Note Added: 0003319 | |
2015-12-11 15:52 | samsonasik | Status | feedback => assigned |
2015-12-11 15:53 | samsonasik | Note Edited: 0003319 | |
2015-12-11 16:48 | derick | Note Added: 0003320 | |
2015-12-11 16:48 | derick | Status | assigned => feedback |
2015-12-11 18:42 | samsonasik | Note Added: 0003323 | |
2015-12-11 18:42 | samsonasik | Status | feedback => assigned |
2015-12-16 17:20 | samsonasik | Note Added: 0003356 | |
2016-01-03 23:59 | ramsey | Note Added: 0003381 | |
2016-01-04 00:00 | ramsey | Note Edited: 0003381 | |
2016-02-08 19:43 | derick | Note Added: 0003447 | |
2016-02-08 19:45 | derick | Note Added: 0003448 | |
2016-02-08 20:27 | ramsey | Note Added: 0003450 | |
2016-02-09 00:33 | samsonasik | Note Added: 0003466 | |
2016-02-11 18:40 | derick | Note Added: 0003481 | |
2016-02-11 18:40 | derick | Status | assigned => resolved |
2016-02-11 18:40 | derick | Resolution | open => no change required |
2016-07-31 12:35 | derick | Category | Debug client (console) => debugclient (debugging tool) |
2016-07-31 12:35 | derick | Category | debugclient (debugging tool) => (No Category) |