View Issue Details

IDProjectCategoryView StatusLast Update
0002308XdebugCode Coveragepublic2024-12-13 17:19
Reporterbmrbehnam Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version3.4.0 
Summary0002308: Incorrect Test Coverage Reports for Untested Files in Laravel with Pest and Xdebug 3.4.0
Description

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.

TagsNo tags attached.
Operating Systemubntu
PHP Version8.3.5-8.3.9

Activities

derick

2024-12-13 17:19

administrator   ~0007114

Hi,

thanks for your report, but in order for me to have a look, I need to be able to reproduce this myself.

Can you provide the exact steps for me to run? Presume I know nothing about Pest and Laravel.

cheers,
Derick

Issue History

Date Modified Username Field Change
2024-12-08 20:30 bmrbehnam New Issue
2024-12-13 17:19 derick Assigned To => derick
2024-12-13 17:19 derick Status new => feedback
2024-12-13 17:19 derick Note Added: 0007114