{"action":"created","issue":{"url":"https://api.github.com/repos/phpspec/prophecy/issues/213","labels_url":"https://api.github.com/repos/phpspec/prophecy/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/phpspec/prophecy/issues/213/comments","events_url":"https://api.github.com/repos/phpspec/prophecy/issues/213/events","html_url":"https://github.com/phpspec/prophecy/issues/213","id":109775942,"number":213,"title":"Make expectation return different result based on call count","user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-05T11:17:09Z","updated_at":"2015-10-05T13:39:07Z","closed_at":null,"body":"On a new project I'm trying out Prophecy to do the mocking instead of Mockery, that I've used before just to see how it works and such.\r\n\r\nSo far I was quite impressed by the fact, that the while describing how Mock should work I was able to spot inefficiencies in class, that was supposed to use the mock and refactor them.\r\n\r\nThe Mockery's feature I'm missing is for mock expectation to return different value based on call number, while each call has exactly same arguments.\r\n\r\nFor example:\r\n\r\n```php\r\n$mock->methodName('param1', 'param2')->willReturn(5); // on 1st call\r\n$mock->methodName('param1', 'param2')->willReturn(6); // on 2nd call\r\n$mock->methodName('param1', 'param2')->willReturn(6); // on other calls\r\n```\r\n\r\nMaybe this can somehow be done through this code, but I don't know yet how exactly:\r\n\r\n```php\r\n$mock->methodName('param1', 'param2')->will(function ($args, $mock) {\r\n    $mock->methodName(...)->will...\r\n});\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/phpspec/prophecy/issues/comments/145530431","html_url":"https://github.com/phpspec/prophecy/issues/213#issuecomment-145530431","issue_url":"https://api.github.com/repos/phpspec/prophecy/issues/213","id":145530431,"user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T13:39:07Z","updated_at":"2015-10-05T13:39:07Z","body":"@ciaranmcnulty, my apologies. I've looked into `->will(` method, but `->willReturn(` will indeed work as  described - accept multiple arguments."}}