From 6a9d9e3b953cb66499dd0ebe5cd0f0f2428320df Mon Sep 17 00:00:00 2001 From: mpyw Date: Sat, 9 Jun 2018 02:32:19 +0900 Subject: [PATCH] Rename GuardHelpers::alreadyAuthenticated() to GuardHelpers::hasUser() --- src/Illuminate/Auth/GuardHelpers.php | 4 ++-- tests/Auth/AuthGuardTest.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Auth/GuardHelpers.php b/src/Illuminate/Auth/GuardHelpers.php index 2bb632ff71f3..291c65d461af 100644 --- a/src/Illuminate/Auth/GuardHelpers.php +++ b/src/Illuminate/Auth/GuardHelpers.php @@ -41,11 +41,11 @@ public function authenticate() } /** - * Determine if the current user is already authenticated without triggering side effects. + * Determine if the guard has the current user without triggering side effects. * * @return bool */ - public function alreadyAuthenticated() + public function hasUser() { return ! is_null($this->user); } diff --git a/tests/Auth/AuthGuardTest.php b/tests/Auth/AuthGuardTest.php index ed09ed320aaf..f353da868dda 100755 --- a/tests/Auth/AuthGuardTest.php +++ b/tests/Auth/AuthGuardTest.php @@ -178,20 +178,20 @@ public function testAuthenticateThrowsWhenUserIsNull() $guard->authenticate(); } - public function testAlreadyAuthenticatedReturnsFalseWhenUserIsNotNull() + public function testHasUserReturnsFalseWhenUserIsNotNull() { $user = m::mock('Illuminate\Contracts\Auth\Authenticatable'); $guard = $this->getGuard()->setUser($user); - $this->assertTrue($guard->alreadyAuthenticated()); + $this->assertTrue($guard->hasUser()); } - public function testAlreadyAuthenticatedReturnsFalseWhenUserIsNull() + public function testHasUserReturnsFalseWhenUserIsNull() { $guard = $this->getGuard(); $guard->getSession()->shouldNotReceive('get'); - $this->assertFalse($guard->alreadyAuthenticated()); + $this->assertFalse($guard->hasUser()); } public function testIsAuthedReturnsTrueWhenUserIsNotNull()