Skip to content

Commit

Permalink
change params
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell authored and bert-w committed Apr 29, 2021
1 parent 2dd9fda commit bf25e3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/SessionGuard.php
Expand Up @@ -379,11 +379,11 @@ public function attempt(array $credentials = [], $remember = false)
* Attempt to authenticate a user with credentials and additional callbacks.
*
* @param array $credentials
* @param false $remember
* @param array|callable $callbacks
* @param false $remember
* @return bool
*/
public function attemptWith(array $credentials = [], $remember = false, $callbacks = null)
public function attemptWhen(array $credentials = [], $callbacks = null, $remember = false)
{
$this->fireAttemptEvent($credentials, $remember);

Expand Down
6 changes: 3 additions & 3 deletions tests/Auth/AuthGuardTest.php
Expand Up @@ -145,14 +145,14 @@ public function testAttemptAndWithCallbacks()
$mock->getProvider()->shouldReceive('validateCredentials')->twice()->andReturnTrue();
$mock->getProvider()->shouldReceive('validateCredentials')->once()->andReturnFalse();

$this->assertTrue($mock->attemptWith(['foo'], false, function ($user, $guard) {
$this->assertTrue($mock->attemptWhen(['foo'], function ($user, $guard) {
static::assertInstanceOf(Authenticatable::class, $user);
static::assertInstanceOf(SessionGuard::class, $guard);

return true;
}));

$this->assertFalse($mock->attemptWith(['foo'], false, function ($user, $guard) {
$this->assertFalse($mock->attemptWhen(['foo'], function ($user, $guard) {
static::assertInstanceOf(Authenticatable::class, $user);
static::assertInstanceOf(SessionGuard::class, $guard);

Expand All @@ -161,7 +161,7 @@ public function testAttemptAndWithCallbacks()

$executed = false;

$this->assertFalse($mock->attemptWith(['foo'], false, function () use (&$executed) {
$this->assertFalse($mock->attemptWhen(['foo'], false, function () use (&$executed) {
return $executed = true;
}));

Expand Down

0 comments on commit bf25e3d

Please sign in to comment.