1

For some reason php unit's code coverage feature is skipping certain lines. I have played around with it a fair amount, and if I just echo ($hydrationData['partnerNames']);, coverage works just fine. I have tried running the tests with --verbose and --debug, but no information is emitted. I have tried this with PHPUnit versions 4.0 and 4.4.

    if(isset($hydrationData['partnerNames'])) {

        // this line will be marked as not covered
        unset($hydrationData['partnerNames']); 

        // got here will be printed during unit test and this line marked as covered
        echo('got here'); 

    }

enter image description here

1 Answer 1

2

Sounds like you found a quirk in either PHP's Zend Engine (likely) or Xdebug (less likely).

There is nothing we can do about this in PHP_CodeCoverage or PHPUnit.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Sebastian, I appreciate your work on the project!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.