{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14374","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14374/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14374/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14374/events","html_url":"https://github.com/laravel/framework/pull/14374","id":166318926,"number":14374,"title":"[5.3] Add support for testing eloquent model events","user":{"login":"thecrypticace","id":614993,"avatar_url":"https://avatars.githubusercontent.com/u/614993?v=3","gravatar_id":"","url":"https://api.github.com/users/thecrypticace","html_url":"https://github.com/thecrypticace","followers_url":"https://api.github.com/users/thecrypticace/followers","following_url":"https://api.github.com/users/thecrypticace/following{/other_user}","gists_url":"https://api.github.com/users/thecrypticace/gists{/gist_id}","starred_url":"https://api.github.com/users/thecrypticace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecrypticace/subscriptions","organizations_url":"https://api.github.com/users/thecrypticace/orgs","repos_url":"https://api.github.com/users/thecrypticace/repos","events_url":"https://api.github.com/users/thecrypticace/events{/privacy}","received_events_url":"https://api.github.com/users/thecrypticace/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-19T12:29:11Z","updated_at":"2016-07-19T15:48:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/14374","html_url":"https://github.com/laravel/framework/pull/14374","diff_url":"https://github.com/laravel/framework/pull/14374.diff","patch_url":"https://github.com/laravel/framework/pull/14374.patch"},"body":"Take 2. I've added a separate method for mocking model events so it shouldn't completely break code using observers (sorry!).\r\n\r\nNotes:\r\n- Observers are explicitly setup to not fire. This is tested for.\r\n- I copied the eloquent setup from the integration tests. Perhaps this code could be moved to a trait? Though, a little duplication here isn't a terribly big deal.\r\n- I'm not 100% pleased with how I had to write the test but I couldn't think of another way to do it. Specifically I extended `Illuminate\\Foundation\\Testing\\TestCase` to treat it as an integration test to be sure it worked within the context of using that class."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/233676308","html_url":"https://github.com/laravel/framework/pull/14374#issuecomment-233676308","issue_url":"https://api.github.com/repos/laravel/framework/issues/14374","id":233676308,"user":{"login":"Jono20201","id":2374192,"avatar_url":"https://avatars.githubusercontent.com/u/2374192?v=3","gravatar_id":"","url":"https://api.github.com/users/Jono20201","html_url":"https://github.com/Jono20201","followers_url":"https://api.github.com/users/Jono20201/followers","following_url":"https://api.github.com/users/Jono20201/following{/other_user}","gists_url":"https://api.github.com/users/Jono20201/gists{/gist_id}","starred_url":"https://api.github.com/users/Jono20201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jono20201/subscriptions","organizations_url":"https://api.github.com/users/Jono20201/orgs","repos_url":"https://api.github.com/users/Jono20201/repos","events_url":"https://api.github.com/users/Jono20201/events{/privacy}","received_events_url":"https://api.github.com/users/Jono20201/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T15:48:03Z","updated_at":"2016-07-19T15:48:03Z","body":"@taylorotwell:\r\n\r\nPlease see:\r\n- https://github.com/laravel/framework/pull/12904\r\n- https://github.com/laravel/framework/issues/12711\r\n\r\nEssentially `$this->expectsEvents('eloquent.saving: App\\Model');` doesn't work because the Mocked dispatcher doesn't get set statically on the Model. Additional code is needed to \"add\" mocked methods onto the mocked dispatcher."}}
{"actor":{"display_login":"Jono20201"}}