I am encountering an issue where Xdebug 3.4.0 reports 100% test coverage for files that do not have any associated tests in a Laravel 11 project using Pest 2.31 for testing.
Environment Details:
PHP Version: 8.3
Xdebug Version: 3.4.0
Testing Framework: Pest 2.31
Framework: Laravel 11
Execution Command: php ./vendor/bin/pest --type-coverage
Coverage Configuration: Using phpunit.xml.dist
Problem:
When running --type-coverage, files that have no tests at all are still reported with 100% coverage. For example:
app/Models/Form.php ....................................................................................................................................................................................................... 100%
app/Models/Group.php ...................................................................................................................................................................................................... 100%
app/Models/UserMeta.php ................................................................................................................................................................................................... 100%
app/Console/Commands/DocumentGenerate.php ................................................................................................................................................................................. 100%
app/Enums/ProductMode.php ................................................................................................................................................................................................. 100%
These files do not have any tests in tests/Unit, tests/Feature, or any other directories specified in the phpunit.xml.dist configuration.
Configuration:
The relevant portion of the phpunit.xml.dist configuration is as follows:
<coverage/>
<source>
<include>
<directory suffix=".php">./app</directory>
</include>
<exclude/>
</source>
Expected Behavior:
Files without any test cases should not be reported as 100% covered. |