I wish to determine which files are covered by each of my test suites separately. I am using PHPUnit 10.5 with xDebug for code coverage on my PHP 8.1 project.
Here is what my phpunit.xml
configuration file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="bootstrap.php" colors="true"
cacheResult="false" stopOnDefect="false"
displayDetailsOnTestsThatTriggerWarnings="true"
cacheDirectory=".phpunit.cache" backupGlobals="true">
<testsuites>
<testsuite name="example">
<file>./ExampleTest.php</file>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">../src</directory>
</include>
</source>>
<coverage>
<report>
<html outputDirectory="html-coverage"/>
</report>
</coverage>
</phpunit>
I have done some research but haven’t found anything helpfull. Is there a way to achieve this?
Could it be that seeking code coverage for a single test suite is considered bad practice, and that’s why no one tried to do it?
Any advice or insights would be greatly appreciated. Thank you!