phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 241 forks source link

Compare callables as an exact match if they are identical #460

Closed ciaranmcnulty closed 4 years ago

ciaranmcnulty commented 4 years ago

Our comparator has always treated callables as not-equal in all cases, however before #446 that error was swallowed and we fell back to other comparison methods.

This fixes #458 by making Closures match when they're identical

It will still be best practice to match on something like Argument::is()

acasademont commented 4 years ago

@ciaranmcnulty thanks a lot 👍