Generator yielding keys that are neither integer or string leads to hard-to-understand error message when used as data provider #4625
Labels
feature/data-provider
Data Providers
feature/test-runner
CLI test runner
type/bug
Something is broken
Summary
When a non int/string key is provided from a generator dataprovider you get an error. This is to be expected. However the error does not make it obvious what went wrong.
Current behavior
How to reproduce
Create a dataprovider that has a non int/string key. and use it in a test (This is valid in PHP btw https://3v4l.org/sbeOf)
Expected behavior
I'd expect to get an error with a clear message, telling me that i'm using a non int/string key in a dataprovider, which is not supported. Prehaps with the type i am using.
Because the error mentions
Util/Annotation/DocBlock.php
we initially though phpunit was failing due to a wrong annotation somewhere.The text was updated successfully, but these errors were encountered: