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.
You have pull requests.
+1 from me, I always run into this issue when mocking.
+1 from me as well
Closing because cloning method parameter will be optional soon (hopefully).