Skip to content

Commit

Permalink
Revert "I maybe just broke it more?"
Browse files Browse the repository at this point in the history
This reverts commit 5e0da74.
  • Loading branch information
naterfute committed Oct 27, 2024
1 parent 5e0da74 commit 20583a7
Show file tree
Hide file tree
Showing 75 changed files with 441 additions and 441 deletions.
6 changes: 3 additions & 3 deletions tests/Assertions/AssertsActivityLogged.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Pyrodactyl\Tests\Assertions;
namespace Pterodactyl\Tests\Assertions;

use PHPUnit\Framework\Assert;
use Illuminate\Support\Facades\Event;
use Pyrodactyl\Events\ActivityLogged;
use Pterodactyl\Events\ActivityLogged;
use Illuminate\Database\Eloquent\Model;
use Pyrodactyl\Models\ActivityLogSubject;
use Pterodactyl\Models\ActivityLogSubject;

trait AssertsActivityLogged
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Assertions/MiddlewareAttributeAssertionsTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Pyrodactyl\Tests\Assertions;
namespace Pterodactyl\Tests\Assertions;

use PHPUnit\Framework\Assert;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application;
namespace Pterodactyl\Tests\Integration\Api\Application;

use Illuminate\Http\Request;
use Pyrodactyl\Models\User;
use Pterodactyl\Models\User;
use PHPUnit\Framework\Assert;
use Pyrodactyl\Models\ApiKey;
use Pyrodactyl\Services\Acl\Api\AdminAcl;
use Pyrodactyl\Tests\Integration\IntegrationTestCase;
use Pterodactyl\Models\ApiKey;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Tests\Integration\IntegrationTestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Pyrodactyl\Tests\Traits\Integration\CreatesTestModels;
use Pyrodactyl\Transformers\Api\Application\BaseTransformer;
use Pyrodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pyrodactyl\Tests\Traits\Http\IntegrationJsonRequestAssertions;
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
use Pterodactyl\Transformers\Api\Application\BaseTransformer;
use Pterodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pterodactyl\Tests\Traits\Http\IntegrationJsonRequestAssertions;

abstract class ApplicationApiIntegrationTestCase extends IntegrationTestCase
{
Expand All @@ -36,7 +36,7 @@ public function setUp(): void
$this->key = $this->createApiKey($this->user);

$this
->withHeader('Accept', 'application/vnd.pyrodactyl.v1+json')
->withHeader('Accept', 'application/vnd.pterodactyl.v1+json')
->withHeader('Authorization', 'Bearer ' . $this->key->identifier . decrypt($this->key->token));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application\Location;
namespace Pterodactyl\Tests\Integration\Api\Application\Location;

use Pyrodactyl\Models\Node;
use Pterodactyl\Models\Node;
use Illuminate\Http\Response;
use Pyrodactyl\Models\Location;
use Pyrodactyl\Transformers\Api\Application\NodeTransformer;
use Pyrodactyl\Transformers\Api\Application\ServerTransformer;
use Pyrodactyl\Transformers\Api\Application\LocationTransformer;
use Pyrodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pterodactyl\Models\Location;
use Pterodactyl\Transformers\Api\Application\NodeTransformer;
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
use Pterodactyl\Transformers\Api\Application\LocationTransformer;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;

class LocationControllerTest extends ApplicationApiIntegrationTestCase
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Integration/Api/Application/Nests/EggControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application\Nests;
namespace Pterodactyl\Tests\Integration\Api\Application\Nests;

use Illuminate\Support\Arr;
use Pyrodactyl\Models\Egg;
use Pterodactyl\Models\Egg;
use Illuminate\Http\Response;
use Pyrodactyl\Transformers\Api\Application\EggTransformer;
use Pyrodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pterodactyl\Transformers\Api\Application\EggTransformer;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;

class EggControllerTest extends ApplicationApiIntegrationTestCase
{
Expand Down
10 changes: 5 additions & 5 deletions tests/Integration/Api/Application/Nests/NestControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application\Nests;
namespace Pterodactyl\Tests\Integration\Api\Application\Nests;

use Illuminate\Http\Response;
use Pyrodactyl\Contracts\Repository\NestRepositoryInterface;
use Pyrodactyl\Transformers\Api\Application\NestTransformer;
use Pyrodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
use Pterodactyl\Transformers\Api\Application\NestTransformer;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;

class NestControllerTest extends ApplicationApiIntegrationTestCase
{
Expand All @@ -26,7 +26,7 @@ public function setUp(): void
*/
public function testNestResponse()
{
/** @var \Pyrodactyl\Models\Nest[] $nests */
/** @var \Pterodactyl\Models\Nest[] $nests */
$nests = $this->repository->all();

$response = $this->getJson('/api/application/nests');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application\Users;
namespace Pterodactyl\Tests\Integration\Api\Application\Users;

use Illuminate\Support\Str;
use Pyrodactyl\Models\User;
use Pterodactyl\Models\User;
use Illuminate\Http\Response;
use Pyrodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;

class ExternalUserControllerTest extends ApplicationApiIntegrationTestCase
{
Expand Down
12 changes: 6 additions & 6 deletions tests/Integration/Api/Application/Users/UserControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Application\Users;
namespace Pterodactyl\Tests\Integration\Api\Application\Users;

use Pyrodactyl\Models\User;
use Pterodactyl\Models\User;
use Illuminate\Http\Response;
use Pyrodactyl\Services\Acl\Api\AdminAcl;
use Pyrodactyl\Transformers\Api\Application\UserTransformer;
use Pyrodactyl\Transformers\Api\Application\ServerTransformer;
use Pyrodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Transformers\Api\Application\UserTransformer;
use Pterodactyl\Transformers\Api\Application\ServerTransformer;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;

class UserControllerTest extends ApplicationApiIntegrationTestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Api/Client/AccountControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client;
namespace Pterodactyl\Tests\Integration\Api\Client;

use Illuminate\Support\Str;
use Pyrodactyl\Models\User;
use Pterodactyl\Models\User;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Hash;

Expand Down
14 changes: 7 additions & 7 deletions tests/Integration/Api/Client/ApiKeyControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client;
namespace Pterodactyl\Tests\Integration\Api\Client;

use Pyrodactyl\Models\User;
use Pterodactyl\Models\User;
use Illuminate\Http\Response;
use Pyrodactyl\Models\ApiKey;
use Pterodactyl\Models\ApiKey;
use Illuminate\Support\Facades\Event;
use Pyrodactyl\Events\ActivityLogged;
use Pterodactyl\Events\ActivityLogged;

class ApiKeyControllerTest extends ClientApiIntegrationTestCase
{
Expand Down Expand Up @@ -98,8 +98,8 @@ public function testApiKeyCannotSpecifyMoreThanFiftyIps()
* Test that no more than 25 API keys can exist at any one time for an account. This prevents
* a DoS attack vector against the panel.
*
* @see https://github.com/pyrodactyl/panel/security/advisories/GHSA-pjmh-7xfm-r4x9
* @see https://github.com/pyrodactyl/panel/issues/4394
* @see https://github.com/pterodactyl/panel/security/advisories/GHSA-pjmh-7xfm-r4x9
* @see https://github.com/pterodactyl/panel/issues/4394
*/
public function testApiKeyLimitIsApplied()
{
Expand All @@ -121,7 +121,7 @@ public function testApiKeyLimitIsApplied()
/**
* Test that a bad request results in a validation error being returned by the API.
*
* @see https://github.com/pyrodactyl/panel/issues/2457
* @see https://github.com/pterodactyl/panel/issues/2457
*/
public function testValidationErrorIsReturnedForBadRequests()
{
Expand Down
32 changes: 16 additions & 16 deletions tests/Integration/Api/Client/ClientApiIntegrationTestCase.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client;
namespace Pterodactyl\Tests\Integration\Api\Client;

use Pyrodactyl\Models\Node;
use Pyrodactyl\Models\Task;
use Pyrodactyl\Models\User;
use Pyrodactyl\Models\Model;
use Pyrodactyl\Models\Backup;
use Pyrodactyl\Models\Server;
use Pyrodactyl\Models\Database;
use Pyrodactyl\Models\Location;
use Pyrodactyl\Models\Schedule;
use Pterodactyl\Models\Node;
use Pterodactyl\Models\Task;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Model;
use Pterodactyl\Models\Backup;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Database;
use Pterodactyl\Models\Location;
use Pterodactyl\Models\Schedule;
use Illuminate\Support\Collection;
use Pyrodactyl\Models\Allocation;
use Pyrodactyl\Models\DatabaseHost;
use Pyrodactyl\Tests\Integration\TestResponse;
use Pyrodactyl\Tests\Integration\IntegrationTestCase;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Models\DatabaseHost;
use Pterodactyl\Tests\Integration\TestResponse;
use Pterodactyl\Tests\Integration\IntegrationTestCase;
use Illuminate\Database\Eloquent\Model as EloquentModel;
use Pyrodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pterodactyl\Transformers\Api\Client\BaseClientTransformer;

abstract class ClientApiIntegrationTestCase extends IntegrationTestCase
{
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function link(mixed $model, ?string $append = null): string
protected function assertJsonTransformedWith(array $data, Model|EloquentModel $model)
{
$reflect = new \ReflectionClass($model);
$transformer = sprintf('\\Pyrodactyl\\Transformers\\Api\\Client\\%sTransformer', $reflect->getShortName());
$transformer = sprintf('\\Pterodactyl\\Transformers\\Api\\Client\\%sTransformer', $reflect->getShortName());

$transformer = new $transformer();
$this->assertInstanceOf(BaseClientTransformer::class, $transformer);
Expand Down
30 changes: 15 additions & 15 deletions tests/Integration/Api/Client/ClientControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client;
namespace Pterodactyl\Tests\Integration\Api\Client;

use Pyrodactyl\Models\User;
use Pyrodactyl\Models\Server;
use Pyrodactyl\Models\Subuser;
use Pyrodactyl\Models\Allocation;
use Pyrodactyl\Models\Permission;
use Pterodactyl\Models\User;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Models\Permission;

class ClientControllerTest extends ClientApiIntegrationTestCase
{
Expand All @@ -18,10 +18,10 @@ class ClientControllerTest extends ClientApiIntegrationTestCase
*/
public function testOnlyLoggedInUsersServersAreReturned()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(3)->create();

/** @var \Pyrodactyl\Models\Server[] $servers */
/** @var \Pterodactyl\Models\Server[] $servers */
$servers = [
$this->createServerModel(['user_id' => $users[0]->id]),
$this->createServerModel(['user_id' => $users[1]->id]),
Expand All @@ -45,11 +45,11 @@ public function testOnlyLoggedInUsersServersAreReturned()
*/
public function testServersAreFilteredUsingNameAndUuidInformation()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(2)->create();
$users[0]->update(['root_admin' => true]);

/** @var \Pyrodactyl\Models\Server[] $servers */
/** @var \Pterodactyl\Models\Server[] $servers */
$servers = [
$this->createServerModel(['user_id' => $users[0]->id, 'name' => 'Julia']),
$this->createServerModel(['user_id' => $users[1]->id, 'uuidShort' => '12121212', 'name' => 'Janice']),
Expand Down Expand Up @@ -143,7 +143,7 @@ public function testServersAreFilteredUsingAllocationInformation()
*/
public function testServersUserIsASubuserOfAreReturned()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(3)->create();
$servers = [
$this->createServerModel(['user_id' => $users[0]->id]),
Expand Down Expand Up @@ -174,7 +174,7 @@ public function testServersUserIsASubuserOfAreReturned()
*/
public function testFilterOnlyOwnerServers()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(3)->create();
$servers = [
$this->createServerModel(['user_id' => $users[0]->id]),
Expand Down Expand Up @@ -223,7 +223,7 @@ public function testPermissionsAreReturned()
*/
public function testOnlyAdminLevelServersAreReturned()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(4)->create();
$users[0]->update(['root_admin' => true]);

Expand Down Expand Up @@ -258,7 +258,7 @@ public function testOnlyAdminLevelServersAreReturned()
*/
public function testAllServersAreReturnedToAdmin()
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(4)->create();
$users[0]->update(['root_admin' => true]);

Expand Down Expand Up @@ -289,7 +289,7 @@ public function testAllServersAreReturnedToAdmin()
#[\PHPUnit\Framework\Attributes\DataProvider('filterTypeDataProvider')]
public function testNoServersAreReturnedIfAdminFilterIsPassedByRegularUser(string $type)
{
/** @var \Pyrodactyl\Models\User[] $users */
/** @var \Pterodactyl\Models\User[] $users */
$users = User::factory()->times(3)->create();

$this->createServerModel(['user_id' => $users[0]->id]);
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Api/Client/SSHKeyControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client;
namespace Pterodactyl\Tests\Integration\Api\Client;

use phpseclib3\Crypt\EC;
use Pyrodactyl\Models\User;
use Pyrodactyl\Models\UserSSHKey;
use Pterodactyl\Models\User;
use Pterodactyl\Models\UserSSHKey;

class SSHKeyControllerTest extends ClientApiIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Pyrodactyl\Tests\Integration\Api\Client\Server\Allocation;
namespace Pterodactyl\Tests\Integration\Api\Client\Server\Allocation;

use Pyrodactyl\Models\Subuser;
use Pyrodactyl\Models\Allocation;
use Pyrodactyl\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;
use Pterodactyl\Models\Subuser;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Tests\Integration\Api\Client\ClientApiIntegrationTestCase;

class AllocationAuthorizationTest extends ClientApiIntegrationTestCase
{
Expand Down
Loading

0 comments on commit 20583a7

Please sign in to comment.