test email signup flow
This commit is contained in:
parent
a95903ed05
commit
9945163a2f
12 changed files with 631 additions and 0 deletions
|
|
@ -64,6 +64,22 @@ class AuthenticateUserTest extends TestCase
|
|||
));
|
||||
}
|
||||
|
||||
public function test_pending_user_throws_unauthorized(): void
|
||||
{
|
||||
$this->userRepository->create(new CreateUserDto(
|
||||
email: new EmailAddress('user@example.com'),
|
||||
passwordHash: null,
|
||||
));
|
||||
|
||||
$this->expectException(UnauthorizedException::class);
|
||||
$this->expectExceptionMessage('invalid credentials');
|
||||
|
||||
$this->useCase->execute(new AuthenticateUserRequest(
|
||||
email: 'user@example.com',
|
||||
password: 'correct-password',
|
||||
));
|
||||
}
|
||||
|
||||
public function test_wrong_password_throws_unauthorized(): void
|
||||
{
|
||||
$this->createUser('correct-password');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue