phpunit-documentation-english icon indicating copy to clipboard operation
phpunit-documentation-english copied to clipboard

Clarify the difference between includeUncoveredFiles and processUncoveredFiles

Open NicoHaase opened this issue 3 years ago • 0 comments

In one of my projects, my main goal is to gather more test coverage. On reviewing the reports, I found that not all of my classes were covered by tests. Mainly Symfony controllers (which are only referenced in YML configuration files) were missing. On debugging the code in \SebastianBergmann\CodeCoverage\CodeCoverage, I found that this happened because I've set processUncoveredFiles="true" in my phpunit.xml. Additionally setting includeUncoveredFiles="true" in the same configuration did not yet resolve my problem, but removing the first option did.

Sadly, I haven't understood the difference between these two options from the current state of the documentation. Otherwise, I'd have opened a PR to clarify why processUncoveredFiles="true" adds some uncovered classes to the report, but not all of them.

As a sidenote, maybe related: this happens when running the tests with pcov. When I generate the coverage using XDebug, all classes are included in the report, regardless which of these two options is set.

NicoHaase avatar Feb 25 '22 12:02 NicoHaase