Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 22, 2022
2 parents 0f53f65 + 96aecce commit 569d7a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function retrieveById($identifier)
$model = $this->createModel();

return $this->newModelQuery($model)
->where($model->qualifyColumn($model->getAuthIdentifierName()), $identifier)
->where($model->getAuthIdentifierName(), $identifier)
->first();
}

Expand All @@ -64,7 +64,7 @@ public function retrieveByToken($identifier, $token)
$model = $this->createModel();

$retrievedModel = $this->newModelQuery($model)->where(
$model->qualifyColumn($model->getAuthIdentifierName()), $identifier
$model->getAuthIdentifierName(), $identifier
)->first();

if (! $retrievedModel) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '9.21.5';
const VERSION = '9.21.6';

/**
* The base path for the Laravel installation.
Expand Down
12 changes: 4 additions & 8 deletions tests/Auth/AuthEloquentUserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public function testRetrieveByIDReturnsUser()
$mock = m::mock(stdClass::class);
$mock->shouldReceive('newQuery')->once()->andReturn($mock);
$mock->shouldReceive('getAuthIdentifierName')->once()->andReturn('id');
$mock->shouldReceive('qualifyColumn')->with('id')->andReturn('users.id');
$mock->shouldReceive('where')->once()->with('users.id', 1)->andReturn($mock);
$mock->shouldReceive('where')->once()->with('id', 1)->andReturn($mock);
$mock->shouldReceive('first')->once()->andReturn('bar');
$provider->expects($this->once())->method('createModel')->willReturn($mock);
$user = $provider->retrieveById(1);
Expand All @@ -40,8 +39,7 @@ public function testRetrieveByTokenReturnsUser()
$mock = m::mock(stdClass::class);
$mock->shouldReceive('newQuery')->once()->andReturn($mock);
$mock->shouldReceive('getAuthIdentifierName')->once()->andReturn('id');
$mock->shouldReceive('qualifyColumn')->with('id')->andReturn('users.id');
$mock->shouldReceive('where')->once()->with('users.id', 1)->andReturn($mock);
$mock->shouldReceive('where')->once()->with('id', 1)->andReturn($mock);
$mock->shouldReceive('first')->once()->andReturn($mockUser);
$provider->expects($this->once())->method('createModel')->willReturn($mock);
$user = $provider->retrieveByToken(1, 'a');
Expand All @@ -55,8 +53,7 @@ public function testRetrieveTokenWithBadIdentifierReturnsNull()
$mock = m::mock(stdClass::class);
$mock->shouldReceive('newQuery')->once()->andReturn($mock);
$mock->shouldReceive('getAuthIdentifierName')->once()->andReturn('id');
$mock->shouldReceive('qualifyColumn')->with('id')->andReturn('users.id');
$mock->shouldReceive('where')->once()->with('users.id', 1)->andReturn($mock);
$mock->shouldReceive('where')->once()->with('id', 1)->andReturn($mock);
$mock->shouldReceive('first')->once()->andReturn(null);
$provider->expects($this->once())->method('createModel')->willReturn($mock);
$user = $provider->retrieveByToken(1, 'a');
Expand All @@ -81,8 +78,7 @@ public function testRetrieveByBadTokenReturnsNull()
$mock = m::mock(stdClass::class);
$mock->shouldReceive('newQuery')->once()->andReturn($mock);
$mock->shouldReceive('getAuthIdentifierName')->once()->andReturn('id');
$mock->shouldReceive('qualifyColumn')->with('id')->andReturn('users.id');
$mock->shouldReceive('where')->once()->with('users.id', 1)->andReturn($mock);
$mock->shouldReceive('where')->once()->with('id', 1)->andReturn($mock);
$mock->shouldReceive('first')->once()->andReturn($mockUser);
$provider->expects($this->once())->method('createModel')->willReturn($mock);
$user = $provider->retrieveByToken(1, 'a');
Expand Down

0 comments on commit 569d7a2

Please sign in to comment.