{"action":"created","issue":{"url":"https://api.github.com/repos/phpspec/phpspec/issues/959","repository_url":"https://api.github.com/repos/phpspec/phpspec","labels_url":"https://api.github.com/repos/phpspec/phpspec/issues/959/labels{/name}","comments_url":"https://api.github.com/repos/phpspec/phpspec/issues/959/comments","events_url":"https://api.github.com/repos/phpspec/phpspec/issues/959/events","html_url":"https://github.com/phpspec/phpspec/issues/959","id":161067311,"number":959,"title":"MethodNotFound not triggered on wrong duringX call","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars.githubusercontent.com/u/239685?v=3","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-19T10:51:32Z","updated_at":"2016-06-19T10:53:28Z","closed_at":null,"body":"When expecting an exception on a wrong method (one that doesn't exists), the `MethodNotFound` does not seem to be triggered in the `DelayedCall` : https://github.com/phpspec/phpspec/blob/master/src/PhpSpec/Matcher/ThrowMatcher.php#L257 if the constructor triggers an error.\r\n\r\nTested with the following snippet ;\r\n\r\n```php\r\n<?php\r\n// snippet in specified class\r\nclass Foo {\r\n     function __construct() {\r\n         trigger_error(E_USER_DEPRECATED, 'foo');\r\n     }\r\n}\r\n\r\n//snippet in spec\r\n$this->shouldThrow(\\Exception::class)->duringNotExistingMethod();\r\n```\r\n\r\nTested with `Instanciation` instead of `Instantiation`, which made me bark at the wrong tree. The expectation never fails (the error is triggered though, and fails the spec). I guess it's because the construction call is made _before_ this check ?"},"comment":{"url":"https://api.github.com/repos/phpspec/phpspec/issues/comments/226990943","html_url":"https://github.com/phpspec/phpspec/issues/959#issuecomment-226990943","issue_url":"https://api.github.com/repos/phpspec/phpspec/issues/959","id":226990943,"user":{"login":"ciaranmcnulty","id":237866,"avatar_url":"https://avatars.githubusercontent.com/u/237866?v=3","gravatar_id":"","url":"https://api.github.com/users/ciaranmcnulty","html_url":"https://github.com/ciaranmcnulty","followers_url":"https://api.github.com/users/ciaranmcnulty/followers","following_url":"https://api.github.com/users/ciaranmcnulty/following{/other_user}","gists_url":"https://api.github.com/users/ciaranmcnulty/gists{/gist_id}","starred_url":"https://api.github.com/users/ciaranmcnulty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciaranmcnulty/subscriptions","organizations_url":"https://api.github.com/users/ciaranmcnulty/orgs","repos_url":"https://api.github.com/users/ciaranmcnulty/repos","events_url":"https://api.github.com/users/ciaranmcnulty/events{/privacy}","received_events_url":"https://api.github.com/users/ciaranmcnulty/received_events","type":"User","site_admin":false},"created_at":"2016-06-19T10:53:28Z","updated_at":"2016-06-19T10:53:28Z","body":"The behaviour you're seeing is that you get a Broken error because of the deprecation warning?"}}
{"actor":{"display_login":"ciaranmcnulty"}}