-
Notifications
You must be signed in to change notification settings - Fork 5
Feature request: Array matcher #13
Comments
The someOf matcher is already implemented. Please see the documentation. The only matcher should be the same as the normal shouldBe matcher? |
Oops, missed that, sorry. Yep, that's one of them, but doesn't look like it supports associative arrays?
I'm not sure. Maybe I'm being fooled by the functionality implemented here: What I'm ultimately after is a more useful error message than "[array:2]"... like which key/value pair didn't match. Something like:
I may be bumping up against a PHPSpec architectural issue, since the presenters only take in one value at a time - no way to cross-compare and display two arrays, for example. |
Any plans to add array matchers (someOf, only)?
I've poked around a bit and see that Sebastian Bergmann's comparator package has a slick ArrayComparator that could be employed. And, this guy made a go of it, but it's not quite right https://github.com/jameshalsall/phpspec-array-contains-matchers
The text was updated successfully, but these errors were encountered: