test SignupUser displayname requirement
Adds displayname to existing assertions and new tests covering: null/short/invalid-charset displayname, duplicate displayname, findability by displayname. AuthenticateUser tests pick up the seedUser displayname argument.
This commit is contained in:
parent
298b8634ec
commit
4829a02aac
2 changed files with 80 additions and 0 deletions
|
|
@ -33,13 +33,16 @@ class AuthenticateUserTest extends TestCase
|
|||
|
||||
private function seedUser(
|
||||
string $email,
|
||||
string $displayName,
|
||||
string $password,
|
||||
bool $isAdmin,
|
||||
): User {
|
||||
return $this->userRepo->create(new CreateUserDto(
|
||||
email: new EmailAddress($email),
|
||||
displayName: $displayName,
|
||||
passwordHash: $this->hasher->hash($password),
|
||||
isAdmin: $isAdmin,
|
||||
emailConfirmedAt: null,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +104,7 @@ class AuthenticateUserTest extends TestCase
|
|||
{
|
||||
$this->seedUser(
|
||||
email: 'user@example.com',
|
||||
displayName: 'user',
|
||||
password: 'correctpassword',
|
||||
isAdmin: false,
|
||||
);
|
||||
|
|
@ -116,6 +120,7 @@ class AuthenticateUserTest extends TestCase
|
|||
{
|
||||
$seeded = $this->seedUser(
|
||||
email: 'user@example.com',
|
||||
displayName: 'user',
|
||||
password: 'correctpassword',
|
||||
isAdmin: false,
|
||||
);
|
||||
|
|
@ -140,6 +145,7 @@ class AuthenticateUserTest extends TestCase
|
|||
{
|
||||
$this->seedUser(
|
||||
email: 'admin@example.com',
|
||||
displayName: 'admin',
|
||||
password: 'adminpassword',
|
||||
isAdmin: true,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue