Skip to content

case line of switch expression incorrectly marked as executable #1158

@fcharrier-okwind

Description

@fcharrier-okwind
Q A
php-code-coverage version 14.1.7
PHP version 8.5.5
Driver PCOV
PCOV version (if used) 1.0.12
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 13.1.4

Hello
I have an app with a 100% code coverage expectation. When I update the dependencies, this requirement is not met. After a few tries, I find that the bug appears in php-code-coverage 14.1.5 version.

Since this version, some lines are incorrectly marked as executable. A fix has beed made in 14.1.7 version, but the problem is still present with case lines.

Code coverage with 14.1.4 version:

Image

Same code coverage report with 14.1.7 version:

Image

=> The "case" lines are marked as non covered.

The point I don't understand is that it works properly on some other switch/case lines:

Image

I probably miss something, but can't understand what.
It's not a cache issue, as I can confirm the problem with my CI job

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions