tests(unit): fix RequireTwoFactorAuthenticationTest
This commit is contained in:
parent
d7d5da6beb
commit
ce7c913e18
5 changed files with 55 additions and 51 deletions
|
@ -24,20 +24,16 @@ class SecurityKeyFactory extends Factory
|
|||
{
|
||||
return [
|
||||
'uuid' => Uuid::uuid4()->toString(),
|
||||
'user_id' => User::factory(),
|
||||
'name' => $this->faker->word,
|
||||
'type' => 'public-key',
|
||||
'transports' => [],
|
||||
'attestation_type' => 'none',
|
||||
'trust_path' => new EmptyTrustPath(),
|
||||
'user_handle' => function (array $attributes) {
|
||||
return User::find($attributes['user_id'])->uuid;
|
||||
},
|
||||
'counter' => 0,
|
||||
];
|
||||
}
|
||||
|
||||
public function withUser(User $user): self
|
||||
{
|
||||
return $this->state([
|
||||
'user_id' => $user->id,
|
||||
'user_handle' => $user->uuid,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue