{"action":"created","issue":{"url":"https://api.github.com/repos/phpspec/prophecy/issues/301","repository_url":"https://api.github.com/repos/phpspec/prophecy","labels_url":"https://api.github.com/repos/phpspec/prophecy/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/phpspec/prophecy/issues/301/comments","events_url":"https://api.github.com/repos/phpspec/prophecy/issues/301/events","html_url":"https://github.com/phpspec/prophecy/issues/301","id":193736677,"number":301,"title":"Prophecy exception hidden by generic exception catch in application code ","user":{"login":"fabianaromagnoli","id":23638004,"avatar_url":"https://avatars.githubusercontent.com/u/23638004?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianaromagnoli","html_url":"https://github.com/fabianaromagnoli","followers_url":"https://api.github.com/users/fabianaromagnoli/followers","following_url":"https://api.github.com/users/fabianaromagnoli/following{/other_user}","gists_url":"https://api.github.com/users/fabianaromagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianaromagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianaromagnoli/subscriptions","organizations_url":"https://api.github.com/users/fabianaromagnoli/orgs","repos_url":"https://api.github.com/users/fabianaromagnoli/repos","events_url":"https://api.github.com/users/fabianaromagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/fabianaromagnoli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-06T10:34:33Z","updated_at":"2016-12-06T10:46:07Z","closed_at":null,"body":"Hi,\r\ngiven this method of a class under test:\r\n\r\n```\r\npublic function run(array $items)\r\n{\r\n    foreach ($items as $item) {\r\n        try {\r\n            $this->doSomethingThatCouldThrowAnyException($item);\r\n            $this->myProphecy->doSomething();\r\n        } catch (Exception $e) {\r\n            continue;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nI have a test that mocks myProphecy behaviour. If I don't set any expectation on this mock, prophecy throws a \\Prophecy\\Exception\\Call\\UnexpectedCallException, but this exception is caught and hidden by the catch in the application code.\r\nI need to catch a generic exception, and not a specific one, because I need the iteration to process all items, even if something for a specific item goes wrong.\r\nWhat can I do to make test properly fail when expectations are not met?"},"comment":{"url":"https://api.github.com/repos/phpspec/prophecy/issues/comments/265118540","html_url":"https://github.com/phpspec/prophecy/issues/301#issuecomment-265118540","issue_url":"https://api.github.com/repos/phpspec/prophecy/issues/301","id":265118540,"user":{"login":"fabianaromagnoli","id":23638004,"avatar_url":"https://avatars.githubusercontent.com/u/23638004?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianaromagnoli","html_url":"https://github.com/fabianaromagnoli","followers_url":"https://api.github.com/users/fabianaromagnoli/followers","following_url":"https://api.github.com/users/fabianaromagnoli/following{/other_user}","gists_url":"https://api.github.com/users/fabianaromagnoli/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianaromagnoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianaromagnoli/subscriptions","organizations_url":"https://api.github.com/users/fabianaromagnoli/orgs","repos_url":"https://api.github.com/users/fabianaromagnoli/repos","events_url":"https://api.github.com/users/fabianaromagnoli/events{/privacy}","received_events_url":"https://api.github.com/users/fabianaromagnoli/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T10:46:07Z","updated_at":"2016-12-06T10:46:07Z","body":"Ok, I suspected that there is nothing to do, but I wanted to be 100% sure.\r\nThanks a lot for your answer."}}
{"actor":{"display_login":"fabianaromagnoli"}}