Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect code coverage with switch(true) - line is not covered #552

Closed
maks-rafalko opened this issue Sep 6, 2017 · 2 comments
Closed

Comments

@maks-rafalko
Copy link

Q A
php-code-coverage version 5.1.0
PHP version 7.1.0
Driver Xdebug
Xdebug version (if used) 2.5.1
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 6.1.0

The line of code with switch(true) is not covered in Code Coverage Data. When it has any other condition, like switch($someVar) - it works as expected

I'm not sure this is an issue with code coverage or xDebug, but I don't have enough knowledge to check it.

coverage

@morozov
Copy link

morozov commented Sep 26, 2017

I have a similar issue in a slightly different setup:

Q A
php-code-coverage version 5.2.2
PHP version 7.1.9
Driver Xdebug
Xdebug version (if used) 2.5.5
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 6.2.4

The line containing assignment of a boolean value to the array element is reported as not covered, however the rest of the assignments in the same array are reported as covered. The file coverage is reported correctly as 100% which probably means that this line is considered non-executable.

552

@morozov
Copy link

morozov commented Oct 10, 2017

It looks like an Xdebug issue (#1479).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants