r/PHPhelp • • Sep 12 '22

Solved Code coverage with PHP 8.2

I've downloaded a PHP 8.2 nightly and testing out my code...

vendor/bin/phpunit --coverage-html coverage/html

PHPUnit 9.5.24 #StandWithUkraine
Runtime: PHP 8.2.0-dev with Xdebug 3.2.0alpha3

....

Generating code coverage report in HTML format ... done [00:03.389]

coverage/html dir is empty

thoughts?

8 Upvotes

1 comment sorted by

3

u/bkdotcom Sep 12 '22 edited Sep 12 '22

Solved

recent update to my unit tests calls chdir(); to update the current working dir..

apparently coverage/html specified on the command line is relative to the cwd within the script...

smells like a bug with phpunit