How do you do code coverage with phpstorm?
I've already setup my project to be able to run, test, and debug (xdebug) with phpstorm tools.
But i can't seem to run code coverage with phpstorm.
It runs the following command to container when i do 'Run TestFileName(PHPUnit) with coverage':
[docker-compose://[/path/to/project_name/docker-compose.yml]:php-dev/]:php -dxdebug.remote_port=19000 -dxdebug.coverage_enable=1 vendor/phpunit/phpunit/phpunit --coverage-clover /opt/phpstorm-coverage/project_name@TestFileName.xml --configuration /var/project_name/phpunit.xml Tests\Unit\TestFileName /var/project_name/tests/Unit/TestFileName.php --teamcity --cache-result-file=/var/project_name/.phpunit.result.cache
When the command line finish executes successfully, it generates a coverage file, that should be read by phpstorm.
But it seems like, phpstorm can't access the coverage file
Resulting in 0% coverage in phpstorm, but the coverage files is actually created in the php container in /opt/phpstorm-coverage/project_name@TestFileName.xml that is passed in the coverage-clover options.
Is there any way to change the location for phpstorm to read coverage files?