Questions regarding PHPUnit mock feature
- by Andree
Can someone provide me a reference to a good PHPUnit mock guide? The one in the official documentation doesn't seem to be detailed enough.
I need to know about the following:
1) How to expect multiple calls to a mock object's method, but each return a different sets of value?
$tableMock->expects($this->exactly(2))
->method('find')
->will($this->returnValue(2)); // I need the second call to return different value
2) How to expect a call to a mock object's method with multiple parameters?