Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior on empty @dataProvider #2392

Closed
ValeriyMaslenikov opened this issue Dec 9, 2016 · 1 comment
Closed

Behavior on empty @dataProvider #2392

ValeriyMaslenikov opened this issue Dec 9, 2016 · 1 comment
Assignees
Labels
type/bug Something is broken

Comments

@ValeriyMaslenikov
Copy link

ValeriyMaslenikov commented Dec 9, 2016

Hi, there are an information here about: "Not all tests can be run in every environment. Consider, for instance, a database abstraction layer that has several drivers for the different database systems it supports."

I had a data provider, which behavior can be different in according to environment, so, there are right cases when it can return an empty array and I expected that the test will be skipped, or even be succeed (cause of empty data to test).

But in the latest stable release (PHPUnit 5.7.3) I had an error like this: Exception: Missing argument 1 for MyTest::test().

I found some workarounds, like explicit test skipping, or even returning an array of false arguments, and checking it in the test, but it's weird.

What do you think about it?

@Wes0617
Copy link
Contributor

Wes0617 commented Dec 10, 2016

I agree. If there are no parameters test must not be run, IMO.
If I returned an empty array (or even null) I'd expect the tests to not be run at all, and not even marked as skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants