Skip to content

Add (opt-in?) support for data providers returning an empty iterable #6404

@stof

Description

@stof

When the data provider generates test cases based on some external sources, it might happen that there is no cases to be tested.
As PHPUnit triggers an error when a data provider returns an empty iterable (technically when all providers configured for a test do it, so that the merged result is empty, but most tests don't use multiple data providers), such projects end up doing hacks where they yield a single case in the data provider with special values that the test detects to call markTestSkipped.

Examples:

It would be great to have a way to opt-out of that error, marking the tests as skipped due to no provided data instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions