sebastianbergmann / phpcov

TextUI frontend for php-code-coverage
BSD 3-Clause "New" or "Revised" License
226 stars 58 forks source link

Incorrect line percentage #89

Closed thewholelifetolearn closed 4 years ago

thewholelifetolearn commented 5 years ago

phpcov gives a 100% coverage for a method but not all are been tested. As it can be seen on the following screenshot, there are lines marked in red but the summary gives 100% covered.

Sorry for the big screenshot, but it is the best way to understand the issue. image

sebastianbergmann commented 5 years ago

Is this a php-code-coverage issue or an issue with phpcov?

thewholelifetolearn commented 5 years ago

I suppose that it comes from phpcov. It is phpcov that comes out with the statistics. The PHP coverage file created by PHPUnit seems correct. The lines marked as red are indeed not tested.
For me, the issue comes from phpcov. How can I verify that?

sebastianbergmann commented 5 years ago

phpcov is merely a CLI frontend for the php-code-coverage library. Do you get the same output if you only use PHPUnit and not phpcov?

thewholelifetolearn commented 5 years ago

It seems that it comes from phpcov. PHPUnit gives a better result:

image

Generated by php-code-coverage 7.0.3 using PHP 7.3.3 with Xdebug 2.7.0 and PHPUnit 8.0.6 at Wed Apr 3 16:46:24 CEST 2019.
thewholelifetolearn commented 5 years ago

But as I mentioned in issue #88 , the calculation method are different.

sebastianbergmann commented 5 years ago

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

thewholelifetolearn commented 5 years ago

I'm at the moment in holidays. I will try to submit a test case before end of May.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

thewholelifetolearn commented 5 years ago

I'm sorry i didn't propose a test case yet. I will propose one this month. I should have more spare time to do that.

sebastianbergmann commented 4 years ago

No feedback, closing.