generateTestAccount(); /** @var \Pterodactyl\Models\User $differentUser */ $differentUser = factory(User::class)->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); /** @var \Pterodactyl\Models\User $subuser */ $subuser = factory(User::class)->create(['uuid' => $uuid]); Subuser::query()->forceCreate([ 'user_id' => $subuser->id, 'server_id' => $server->id, 'permissions' => [ Permission::ACTION_WEBSOCKET_CONNECT ], ]); $this->actingAs($user)->deleteJson($this->link($server) . "/users/{$subuser->uuid}")->assertNoContent(); // Try the same test, but this time with a UUID that if cast to an int (shouldn't) line up with // anything in the database. $uuid = '18180000' . substr(Uuid::uuid4()->toString(), 8); /** @var \Pterodactyl\Models\User $subuser */ $subuser = factory(User::class)->create(['uuid' => $uuid]); Subuser::query()->forceCreate([ 'user_id' => $subuser->id, 'server_id' => $server->id, 'permissions' => [ Permission::ACTION_WEBSOCKET_CONNECT ], ]); $this->actingAs($user)->deleteJson($this->link($server) . "/users/{$subuser->uuid}")->assertNoContent(); } }