Skip to content

Improve error when configured code coverage file list is empty #4440

@tlamy

Description

@tlamy
Q A
PHPUnit version 9.3.8
PHP version 7.4.8
Installation Method Composer

Summary

When running phpunit in a more or less empty project, "Incorrect filter configuration" is shown when there are no files to cover. This is misleadig.

Current behavior

A misleading error message Warning: Incorrect filter configuration, code coverage will not be processed is shown when no source files present in covered path(s)

How to reproduce

Expected behavior

Show no error message (maybe a warning that there are no files to cover), but 0% coverage, and "No tests executed".

As soon as a (even an empty) .php file is added to the src directory, the expected behaviour is shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions