diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php index 11660401ef49..be6a977d18a9 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php @@ -82,6 +82,8 @@ public function assertAuthenticatedAs($user, $guard = null) { $expected = $this->app->make('auth')->guard($guard)->user(); + $this->assertNotNull($expected, 'The current user is not authenticated.'); + $this->assertInstanceOf( get_class($expected), $user, 'The currently authenticated user is not who was expected'