-
-
Notifications
You must be signed in to change notification settings - Fork 73
TestCase: data provider supports \Traversable #272
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
Conversation
src/Framework/TestCase.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO version check is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll get rid of it
|
👍 |
|
What about to support |
|
@milo I thought about it, but didn't find any use case for |
870b790 to
027fb44
Compare
|
I've added support for Traversable and squashed the branch into a single commit. |
src/Framework/TestCase.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why leading slash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
|
Imho ready to merge. I left few CS hint comments. |
|
@milo I've fixed the CS compliance. Should I squash it now? |
|
Yes please. |
98b0db6 to
7066509
Compare
|
Squashed. |
TestCase: data provider supports \Traversable
|
Thank you. |
I've found that if you want to return some more complex structures from a data provider or even do some other logic to it inbetween, generators seem to be a more convenient approach than arrays.
In my case, I need to test data validation of a third-party API, generating a valid request and breaking it in a lot of slightly different ways, and generators just seem to be much more expressive: