Problem
When forceCoversAnnotation="true" and addUncoveredFilesFromWhitelist="true" used at the same time, files and directories uncovered using addUncoveredFilesFromWhitelist option are not added to coverage report.
If forceCoversAnnotation="false" everything works as expected.
Details
The reason is, that the uncovered files found in PHP_CodeCoverage->processUncoveredFilesFromWhitelist() method are passed to append() method (line 520):
$this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST');
later (in ->append()) they would be passed to applyCoversAnnotationFilter() (line 256):
$this->applyCoversAnnotationFilter($data, $id);
// equals to $this->applyCoversAnnotationFilter($data, 'UNCOVERED_FILES_FROM_WHITELIST');
and than emptied in applyCoversAnnotationFilter() lines (421-423)
...
else if ($this->forceCoversAnnotation) {
$data = array();
}
because $id ('UNCOVERED_FILES_FROM_WHITELIST') is not an instance of PHPUnit_Framework_TestCase and forceCoversAnnotation is on.
Proposed solution
Before passing files to applyCoversAnnotationFilter, it should be checked whether $id == 'UNCOVERED_FILES_FROM_WHITELIST'
See b4a1e18 for 1.0 branch.