test email signup flow

This commit is contained in:
Yisroel Baum 2026-08-03 20:22:50 +03:00
parent a95903ed05
commit 9945163a2f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
12 changed files with 631 additions and 0 deletions

View file

@ -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');