{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/18837","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/18837/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/18837/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/18837/events","html_url":"https://github.com/laravel/framework/issues/18837","id":222253917,"number":18837,"title":"#18769 seem to break my unit tests - eloquent model db connection inconsistency","user":{"login":"fgreinus","id":1236785,"avatar_url":"https://avatars0.githubusercontent.com/u/1236785?v=3","gravatar_id":"","url":"https://api.github.com/users/fgreinus","html_url":"https://github.com/fgreinus","followers_url":"https://api.github.com/users/fgreinus/followers","following_url":"https://api.github.com/users/fgreinus/following{/other_user}","gists_url":"https://api.github.com/users/fgreinus/gists{/gist_id}","starred_url":"https://api.github.com/users/fgreinus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgreinus/subscriptions","organizations_url":"https://api.github.com/users/fgreinus/orgs","repos_url":"https://api.github.com/users/fgreinus/repos","events_url":"https://api.github.com/users/fgreinus/events{/privacy}","received_events_url":"https://api.github.com/users/fgreinus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-17T22:54:42Z","updated_at":"2017-04-17T22:54:42Z","closed_at":null,"body":"- Laravel Version: 5.4.19\r\n- PHP Version: 7.1.4\r\n- Database Driver & Version: mysql\r\n\r\n### Description:\r\nWhen I upgraded from laravel/framework 5.4.18 to 5.4.19 some of my unit tests broke. This is because somehow the models i get when making http requests (via the BrowserKitTest features) now have a connection provided, while the user i create via a factory and then use within the application via $this->actingAs have null as db connection. This leads to false returns when doing checks via $user->is($modelFromRouteModelBinding->user);\r\n\r\n### Steps To Reproduce:\r\nUse $this->actingAs($userFromFactory) in BrowserKitTests and then call some of your routes via $this->json('GET', '/test') or so. When you use checks i.e. for security like $userFromRequest->is($modelFromRouteModelBinding->user), you will get false because the connections differ (null vs the (now) correct connection).\r\n"}}
{"actor":{"display_login":"fgreinus"}}