diff --git a/src/Illuminate/Auth/SessionGuard.php b/src/Illuminate/Auth/SessionGuard.php index 9187315db207..769edb204330 100644 --- a/src/Illuminate/Auth/SessionGuard.php +++ b/src/Illuminate/Auth/SessionGuard.php @@ -173,10 +173,6 @@ public function user() } } - if (is_null($this->user)) { - $this->clearUserDataFromStorage(); - } - return $this->user; } diff --git a/tests/Auth/AuthGuardTest.php b/tests/Auth/AuthGuardTest.php index 0a99502a6157..52c4cfe7d1c8 100755 --- a/tests/Auth/AuthGuardTest.php +++ b/tests/Auth/AuthGuardTest.php @@ -262,9 +262,6 @@ public function testAuthenticateThrowsWhenUserIsNull() $this->expectExceptionMessage('Unauthenticated.'); $guard = $this->getGuard(); - $guard->setCookieJar($cookies = m::mock(CookieJar::class)); - $cookies->shouldReceive('unqueue')->once(); - $guard->getSession()->shouldReceive('remove')->once(); $guard->getSession()->shouldReceive('get')->once()->andReturn(null); $guard->authenticate(); @@ -316,9 +313,6 @@ public function testUserMethodReturnsCachedUser() public function testNullIsReturnedForUserIfNoUserFound() { $mock = $this->getGuard(); - $mock->setCookieJar($cookies = m::mock(CookieJar::class)); - $cookies->shouldReceive('unqueue')->once(); - $mock->getSession()->shouldReceive('remove')->once(); $mock->getSession()->shouldReceive('get')->once()->andReturn(null); $this->assertNull($mock->user()); }