Skip to content

Commit

Permalink
chore: remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Nov 18, 2024
1 parent c9c5cf9 commit 893759e
Showing 1 changed file with 0 additions and 91 deletions.
91 changes: 0 additions & 91 deletions framework/core/tests/integration/api/users/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,97 +138,6 @@ public function admins_can_create_activated_users()
$this->assertEquals(1, $user->is_email_confirmed);
}

#[Test]
public function admin_can_create_user_with_longest_possible_local_part_email()
{
$email = str_repeat('a', 64).'@machine.local';

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

$this->assertEquals(201, $response->getStatusCode());

/** @var User $user */
$user = User::where('username', 'test')->firstOrFail();

$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]
public function admin_can_create_user_with_longest_valid_domain()
{
$email = 't@'.str_repeat('a', 63).'.'.str_repeat('b', 63).'.'.str_repeat('c', 63).'.'.str_repeat('d', 58).'.x';

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

$this->assertEquals(201, $response->getStatusCode());

/** @var User $user */
$user = User::where('username', 'test')->firstOrFail();

$this->assertEquals($email, $user->email);
}

#[Test]
public function admin_can_create_user_with_longest_valid_email()
{
Expand Down

0 comments on commit 893759e

Please sign in to comment.