Skip to content

Loading…

identicalTo() matcher for mock objects parameters #41

Closed
giorgiosironi opened this Issue · 5 comments

4 participants

@giorgiosironi

Since matcher's object parameters are cloned, identicalTo() in with() calls on mock expectations always fails.
I thought it can save the spl_object_hash() somewhere before cloning the object, so that it can be matched even if the original object is thrown away. If you're interested, I can implement it.

@sebastianbergmann

Sounds interesting!

@ezzatron

+1 from me, I always run into this issue when mocking.

@tolleiv

+1 from me as well

@sebastianbergmann

Closing because cloning method parameter will be optional soon (hopefully).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.