Hi everyone,

I'm fixing automated test-'testCreateIncidentFromBugReport()' for error-reporting-server and need a little help with 'Mock Objects'.

See L#263 [0]. Because of 'will($this->returnValue(true))' there, 'Incident:save()' method of the mock object returns 'true' inside 'Incident::createIncidentFromBugReport()' (called at [3]). 
Now, I want to make 'save()' method of the mock object to do initialization of '$this' (incident object on which it operates). It is necessary because 'Incident::createIncidentFromBugReport()' is designed to return array of ids of newly created incidents [1]. Currently '$this' is not initialized and that's why '$this->id' is 'bool(false)' [2] in the log.

How can that be done?? Is there any method like 'returnValue()' to achieve that??


[0]: https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2L262
[1]: https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-5cd1459197cc4c095b963a99c7b97d90R208
[2]: https://travis-ci.org/dhananjay92/error-reporting-server/jobs/26998211#L259
[3]: https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2R271


Thanks,
Dhananjay Nakrani.