I have the directories: ProjectName/Module/Application and ProjectName/Module/MyApi
I used Laminas. And when I run in cmd:
./vendor/bin/phpunit.bat --coverage-html=test/reports --whitelist=module\Application\src\*
the response is:
PHPUnit 8.5.2-60-ga07c36460 by Sebastian Bergmann and contributors.
.................. 18 / 18 (100%)
Time: 1.28 seconds, Memory: 10.00 MB
OK (18 tests, 94 assertions)
Generating code coverage report in HTML format ... done [136 ms]
PS C:\xampp\htdocs\ProjectName> ./vendor/bin/phpunit.bat --coverage-html=test/reports --whitelist=module\Application\src\* PHPUnit 8.5.2-60-ga07c36460 by Sebastian Bergmann and contributors.
.................. 18 / 18 (100%)
Time: 1.55 seconds, Memory: 10.00 MB
OK (40 tests, 102 assertions)
Generating code coverage report in HTML format ... done [518 ms]
but if I run:
./vendor/bin/phpunit.bat --coverage-html=test/reports --whitelist=module\MyApi\src\*
the response is only:
PHPUnit 8.5.2-60-ga07c36460 by Sebastian Bergmann and contributors.
and nothing else.
I configured correctly phpdbg, phpunit.xml and bootstrap.php, in fact the code coverage is generated correctly in module Application, although it is 0%.
In composer.json also also added:
"autoload-dev": {
"psr-4": {
"ApplicationTest\\": "module/Application/test/",
"ProjectNameSpace\\Domain\\Tests\\": "module/MyApi/src/V1/Domain/test/"
},
but I don't understand why this happens. thanks in advance.