extend User entity with displayname and email confirmation
Add display_name (unique) and email_confirmed_at columns plus matching getters, DTO fields, repo methods (findByDisplayName, update), and migration. Existing auth tests updated to construct User with the new params.
This commit is contained in:
parent
d547ec2c61
commit
298b8634ec
10 changed files with 131 additions and 15 deletions
|
|
@ -58,13 +58,15 @@ class AuthMiddlewareTest extends TestCase
|
|||
};
|
||||
}
|
||||
|
||||
private function makeUser(int $id = 7): User
|
||||
private function makeUser(int $id): User
|
||||
{
|
||||
return new User(
|
||||
id: $id,
|
||||
email: new EmailAddress('user@example.com'),
|
||||
displayName: 'user',
|
||||
passwordHash: 'hashed:irrelevant',
|
||||
isAdmin: false,
|
||||
emailConfirmedAt: null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +102,7 @@ class AuthMiddlewareTest extends TestCase
|
|||
{
|
||||
$this->sessionRepo->create(new CreateSessionDto(
|
||||
token: 'expired-token',
|
||||
user: $this->makeUser(),
|
||||
user: $this->makeUser(7),
|
||||
createdAt: $this->now->modify('-8 days'),
|
||||
expiresAt: $this->now->modify('-1 day'),
|
||||
));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue