Skip to content

Commit

Permalink
test: write test for email with too long local part
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Nov 18, 2024
1 parent e9d6b05 commit c828b0a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions framework/core/tests/integration/api/users/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,35 @@ public function admin_can_create_user_with_longest_possible_local_part_email()
$this->assertEquals($email, $user->email);
}

/**
* @test
*/
public function admin_cannot_create_user_with_invalid_local_part_email()
{
$email = str_repeat('a', 65) . '@machine.local';

$response = $this->send(
$this->request(
'POST',
'/api/users',
[
'authenticatedAs' => 1,
'json' => [
'data' => [
'attributes' => [
'username' => 'test',
'password' => 'too-obscure',
'email' => $email,
],
]
],
]
)
);

$this->assertEquals(422, $response->getStatusCode());
}

/**
* @test
*/
Expand Down

0 comments on commit c828b0a

Please sign in to comment.