tests(unit): fix RequireTwoFactorAuthenticationTest

This commit is contained in:
Matthew Penner 2022-10-31 13:20:06 -06:00
parent d7d5da6beb
commit ce7c913e18
No known key found for this signature in database
5 changed files with 55 additions and 51 deletions

View file

@ -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,
]);
}
}