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

No coverage inside elseif clause when checking empty() on a method scope variable #627

Closed
AMRoche opened this issue Jun 21, 2018 · 2 comments

Comments

@AMRoche
Copy link

AMRoche commented Jun 21, 2018

Q A
php-code-coverage version 6.0.7
PHP version 7.2.6
Driver Xdebug
Xdebug version (if used) 2.6
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 7.2.4

When using empty() inside an elseif clause, checking against a variable in the same scope, the line containing the elseif is not marked as covered - despite the contents of the elseif being marked as covered. Seems to be something in the same vein as #620 .

screen shot 2018-06-21 at 12 47 24

Note that the issue does not occur when the line is else if , or the variable being checked occurs on a class level instead.

To this end, I have attached a sample class and tests - to run these tests, run composer install && composer test from inside the root directory of the unzipped folder. Note that in the coverage results (as screenshotted above) , the inputSetsINternalVariableToNull and inputSetsVariableToNull functions are the only ones that exhibit that issue.

phpunit.zip

@stale
Copy link

stale bot commented Aug 20, 2018

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.

@stale stale bot added the stale label Aug 20, 2018
@stale
Copy link

stale bot commented Aug 27, 2018

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.

@stale stale bot closed this as completed Aug 27, 2018
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

1 participant