I have a project where I ran phpunit with code coverage on the ./app
folder. This worked fine and the phpunit.xml
file had this section.
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
Since then, I changed the structure and made namespaced modules. Now the code coverage does not cover the modules at all. My phpunit.xml
section looks like this now.
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./module/module-one/src</directory>
<directory suffix=".php">./module/module-two/src</directory>
<directory suffix=".php">./module/module-three/src</directory>
</include>
</coverage>
After this change, only the ./app
files are shown in the report and there is no indication of any other files. Even the report root is /app
. I have tried several configurations e.g. using only ./module
as the directory, but nothing has worked.
The phpunit.xml
file is being read, because the generation reacts to changes in the file.
How can I include the rest of the files in the report?
PHPunit version is 9.5.13, XDebug version is 3.0.3, and Code Coverage version is 1.0.8
Please check your composer.json that need to autoload each module folders you provided.
Please make sure that your Pcov exensions disabled on the first place.
pcov.enabled=0
https://github.com/krakjoe/pcov