<div dir="ltr">Hi everyone,<div><br></div><div>I'm fixing automated test-'testCreateIncidentFromBugReport()' for error-reporting-server and need a little help with 'Mock Objects'.</div><div><br></div><div style>
See L#263 [0]. Because of '<span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px">will($this->returnValue(true))</span>' there, 'Incident:save()' method of the mock object returns 'true' inside 'Incident::createIncidentFromBugReport()' (called at [3]). </div>
<div style>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.</div>
<div style><br></div><div style>How can that be done?? Is there any method like 'returnValue()' to achieve that??</div>
<div><br></div><div><br></div><div>[0]: <a href="https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2L262">https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2L262</a></div>

<div>[1]: <a href="https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-5cd1459197cc4c095b963a99c7b97d90R208">https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-5cd1459197cc4c095b963a99c7b97d90R208</a></div>
<div>[2]: <a href="https://travis-ci.org/dhananjay92/error-reporting-server/jobs/26998211#L259">https://travis-ci.org/dhananjay92/error-reporting-server/jobs/26998211#L259</a></div><div>[3]: <a href="https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2R271">https://github.com/dhananjay92/error-reporting-server/compare/b71453d3eaf4...8a8bc7a700b8#diff-e77d61995cbbaa85aa84de5f5c24adc2R271</a></div>
<div><br></div><div><br></div><div>Thanks,</div><div>Dhananjay Nakrani.</div></div>