1

In those days made a tool in a selfmade framework, and setted up unit tests with PHPUnit for that (whitout Symfony). Then i could make tests with codecoverage whitout problems.

Now i migrated my tool as a Symfony bundle. I can test it now with no errors (whitout codecoverage)

I googled and didn't found anything about CodeCoverage.php undefined notice problems.

phpunit -c app src/myVendor/myBundle/

..............................................................  62 / 139 ( 44%)
.............................................................. 124 / 139 ( 89%)
...............
Time: 14.5 seconds, Memory: 45.00Mb
OK (139 tests, 5733 assertions)

But when i add the logging configuration for codecoverage, the execution will crash. But it worked before i migrated my tool into a bundle.

<phpunit bootstrap="bootstrap.php.cache"
         stopOnError="true"
         stopOnFailure="true"
         stopOnRisky="true"
         stopOnIncomplete="true"
         stopOnSkipped="true"
>
    <logging>
        <log    type="coverage-html"
                target="C:/Users/FPI/Desktop/PHPUnit_CodeCoverage/html"
                lowUpperBound="35"
                highLowerBound="70"/>
        </logging>
</phpunit>

I recieve this error:

Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Notice: Undefined offset: 4658' in phar://C:/bin/phpunit/php-code-coverage/CodeCoverage.php on line 694

Symfony\Component\Debug\Exception\ContextErrorException: Notice: Undefined offset: 4658 in phar://C:/bin/phpunit/php-code-coverage/CodeCoverage.php on line 694

Call Stack:
   34.3818   45467848   1. Symfony\Component\Debug\ErrorHandler->handleException() D:\Projekte\myproject\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php:0

Thanks in advice for help. PHPUnit v 4.6.9. PHP 5.5.26.

1
  • 2
    Can you update PHPUnit to the latest version? Did you whitelisted the coverage to the strict minimum of files? Commented Aug 31, 2015 at 14:10

1 Answer 1

1

Thanks to @Jean, an PHPUnit update fixed this issue.

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

Comments

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.