I am writing a unit test for a method using PHPUnit. The method I am testing makes a call to the same method on the same object 3 times but with different sets of arguments.
For others who are looking to both match input parameters and provide return values for multiple calls.. this works for me:
$mock->method('myMockedMethod') ->withConsecutive([$argA1, $argA2], [$argB1, $argB2], [$argC1, $argC2]) ->willReturnOnConsecutiveCalls($retValue1, $retValue2, $retValue3);