Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Added byId test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Mar 19, 2019
1 parent 6c2a20a commit 8d3815c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/UserResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,25 @@ public function by_credentials_retrieves_alternate_username_attribute_depending_
}

/** @test */
public function by_model_retrieves_user_by_object_guid()
public function by_id_retrieves_user_by_object_guid()
{
$user = $this->makeLdapUser();

$guid = $this->faker->uuid;

$query = m::mock(Builder::class);

$query->shouldReceive('findByGuid')->once()->with($guid)->andReturn($user);

$r = m::mock(UserResolver::class)->makePartial();

$r->shouldReceive('query')->andReturn($query);

$this->assertEquals($user, $r->byId($guid));
}

/** @test */
public function by_model_retrieves_user_by_models_object_guid()
{
$model = new TestUser([
'objectguid' => $this->faker->uuid
Expand Down

0 comments on commit 8d3815c

Please sign in to comment.