Marcelo Marcelo - 2 months ago 6
PHP Question

How to mock the same method in Prophecy so it retruns different response in each of its calls

In pure PHPUnit mocking I can do something like this:



I was not able to do the same thing using Prophecy. Is it possible?


You can use:

$mock->isReady()->willReturn(false, true);

Apparently it's not documented (see because Prophecy is opinionated and knows better than us. Sigh.