PHPUnit: Test Closures with Mockery::spy
Originally published at recca0120.github.io
When a function accepts a callback parameter, how do you verify in PHPUnit that the callback was actually called, with the correct arguments and the right number of times?
What's Wrong with the Naive Approa...