Phpunit error "This build of PHPDBG does not support code coverage"

217 Views Asked by At

I'm getting error "This build of PHPDBG does not support code coverage" when try to run phpunit with coverage with phpdbg. I found in PHAR line which generate this error:

        if (!\function_exists('PHPUnit\\phpdbg_start_oplog')) {
            throw new \PHPUnit\SebastianBergmann\CodeCoverage\RuntimeException('This build of PHPDBG does not support code coverage');
        }

Then i run and get this result:

prompt> ev function_exists('phpdbg_start_oplog');
1

As i undestand, problem is in namespace before phpdbg_start_oplog. So, why phpdbg_start_oplog is prefixed with PHPUnit namespace in PHAR?

PHPUnit 9.1.4 by Sebastian Bergmann and contributors.

PHP 7.4.1 (cli) (built: Dec 28 2019 11:16:02) ( NTS )

1

There are 1 best solutions below

0
Sebastian Bergmann On

You found a bug in PHPUnit (or PHP-Scoper, one of the tools involved in building the PHAR distribution of PHPUnit). I opened a ticket for this issue on GitHub.