mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-29 03:23:45 +02:00
Reformat for csfixer
This commit is contained in:
@@ -24,7 +24,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount($permissions);
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email = $this->faker->email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -61,7 +61,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
Permission::ACTION_CONTROL_CONSOLE,
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email = $this->faker->email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -83,7 +83,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
|
||||
$email = str_repeat(Str::random(20), 9) . '1@gmail.com'; // 191 is the hard limit for the column in MySQL.
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -92,7 +92,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email . '.au',
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -115,7 +115,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
/** @var \Pterodactyl\Models\User $existing */
|
||||
$existing = User::factory()->create(['email' => $this->faker->email]);
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $existing->email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -135,7 +135,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
[$user, $server] = $this->generateTestAccount();
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email = $this->faker->email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
@@ -144,7 +144,7 @@ class CreateServerSubuserTest extends ClientApiIntegrationTestCase
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . "/users", [
|
||||
$response = $this->actingAs($user)->postJson($this->link($server) . '/users', [
|
||||
'email' => $email,
|
||||
'permissions' => [
|
||||
Permission::ACTION_USER_CREATE,
|
||||
|
||||
@@ -33,7 +33,7 @@ class DeleteSubuserTest extends ClientApiIntegrationTestCase
|
||||
$differentUser = User::factory()->create();
|
||||
|
||||
// Generate a UUID that lines up with a user in the database if it were to be cast to an int.
|
||||
$uuid = $differentUser->id . str_repeat('a', strlen((string)$differentUser->id)) . substr(Uuid::uuid4()->toString(), 8);
|
||||
$uuid = $differentUser->id . str_repeat('a', strlen((string) $differentUser->id)) . substr(Uuid::uuid4()->toString(), 8);
|
||||
|
||||
/** @var \Pterodactyl\Models\User $subuser */
|
||||
$subuser = User::factory()->create(['uuid' => $uuid]);
|
||||
|
||||
@@ -43,12 +43,12 @@ class SubuserAuthorizationTest extends ClientApiIntegrationTestCase
|
||||
}
|
||||
|
||||
// This route is acceptable since they're accessing a subuser on their own server.
|
||||
$this->actingAs($user)->json($method, $this->link($server1, "/users/" . $internal->uuid))->assertStatus($method === 'POST' ? 422 : ($method === 'DELETE' ? 204 : 200));
|
||||
$this->actingAs($user)->json($method, $this->link($server1, '/users/' . $internal->uuid))->assertStatus($method === 'POST' ? 422 : ($method === 'DELETE' ? 204 : 200));
|
||||
|
||||
// This route can be revealed since the subuser belongs to the correct server, but
|
||||
// errors out with a 403 since $user does not have the right permissions for this.
|
||||
$this->actingAs($user)->json($method, $this->link($server2, "/users/" . $internal->uuid))->assertForbidden();
|
||||
$this->actingAs($user)->json($method, $this->link($server3, "/users/" . $internal->uuid))->assertNotFound();
|
||||
$this->actingAs($user)->json($method, $this->link($server2, '/users/' . $internal->uuid))->assertForbidden();
|
||||
$this->actingAs($user)->json($method, $this->link($server3, '/users/' . $internal->uuid))->assertNotFound();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,6 +56,6 @@ class SubuserAuthorizationTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function methodDataProvider(): array
|
||||
{
|
||||
return [["GET"], ["POST"], ["DELETE"]];
|
||||
return [['GET'], ['POST'], ['DELETE']];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user