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

Switch cases not being covered #2953

Closed
injitools opened this issue Jan 7, 2018 · 8 comments
Closed

Switch cases not being covered #2953

injitools opened this issue Jan 7, 2018 · 8 comments

Comments

@injitools
Copy link

Q A
PHPUnit version 6.5.5
PHP version 7.2.0 windows
Installation Method PHAR

the problem is that lines with the switch case are not covered, the switch cases themselves are being executed.

2018-01-06_22-13-01

@sebastianbergmann
Copy link
Owner

This should have been reported on the php-code-coverage project.

I am sorry that I have to close this issue here as GitHub does not support moving issues from one project to another.

@sebastianbergmann
Copy link
Owner

This is probably an Xdebug issue, see xdebug/xdebug#398.

CC @derickr

@derickr
Copy link
Contributor

derickr commented Jan 7, 2018

Looks like it. But that issue is already fixed in Xdebug's master branch.

@eghojansu
Copy link

I am using phpdbg and get this issue too.

PHPUnit 7.5.1
phpdbg 0.5.0 (built: Sep 13 2018 13:45:02)
PHP 7.2.10-0ubuntu0.18.04.1, Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

@l0gicgate
Copy link

@eghojansu experiencing same issue, Xdebug has this fixed but phpdbg doesn't

@pablorsk
Copy link

pablorsk commented Nov 3, 2019

any ideas for a possible solution with phpdbg?

@dmlogic
Copy link

dmlogic commented Nov 13, 2019

I'm also getting this when using phpdbg / phpunit 8.4.3.

Workaround is to move the case statements onto one line (which fortunately is practical in this case).

Can we re-open this or should I post a new issue?

@pablorsk
Copy link

pablorsk commented Nov 13, 2019

Hi @dmlogic, thats a temporary solution. On my company, we solve with EnumClass. More options and information here: https://stackoverflow.com/a/58766230/860878

Also, @sebastianbergmann post on my question this:

Do yourself a favor and do not use PHPDBG for code coverage. Use PCOV oder Xdebug instead

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

7 participants