Skip to content

Commit

Permalink
I maybe just broke it more?
Browse files Browse the repository at this point in the history
  • Loading branch information
naterfute committed Oct 27, 2024
1 parent 98f228c commit 5e0da74
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 Pterodactyl\Tests\Assertions;
namespace Pyrodactyl\Tests\Assertions;

use PHPUnit\Framework\Assert;
use Illuminate\Support\Facades\Event;
use Pterodactyl\Events\ActivityLogged;
use Pyrodactyl\Events\ActivityLogged;
use Illuminate\Database\Eloquent\Model;
use Pterodactyl\Models\ActivityLogSubject;
use Pyrodactyl\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 Pterodactyl\Tests\Assertions;
namespace Pyrodactyl\Tests\Assertions;

use PHPUnit\Framework\Assert;

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

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

use Illuminate\Http\Request;
use Pterodactyl\Models\User;
use Pyrodactyl\Models\User;
use PHPUnit\Framework\Assert;
use Pterodactyl\Models\ApiKey;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Tests\Integration\IntegrationTestCase;
use Pyrodactyl\Models\ApiKey;
use Pyrodactyl\Services\Acl\Api\AdminAcl;
use Pyrodactyl\Tests\Integration\IntegrationTestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
use Pterodactyl\Transformers\Api\Application\BaseTransformer;
use Pterodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pterodactyl\Tests\Traits\Http\IntegrationJsonRequestAssertions;
use Pyrodactyl\Tests\Traits\Integration\CreatesTestModels;
use Pyrodactyl\Transformers\Api\Application\BaseTransformer;
use Pyrodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pyrodactyl\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.pterodactyl.v1+json')
->withHeader('Accept', 'application/vnd.pyrodactyl.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 Pterodactyl\Tests\Integration\Api\Application\Location;
namespace Pyrodactyl\Tests\Integration\Api\Application\Location;

use Pterodactyl\Models\Node;
use Pyrodactyl\Models\Node;
use Illuminate\Http\Response;
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;
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;

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 Pterodactyl\Tests\Integration\Api\Application\Nests;
namespace Pyrodactyl\Tests\Integration\Api\Application\Nests;

use Illuminate\Support\Arr;
use Pterodactyl\Models\Egg;
use Pyrodactyl\Models\Egg;
use Illuminate\Http\Response;
use Pterodactyl\Transformers\Api\Application\EggTransformer;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pyrodactyl\Transformers\Api\Application\EggTransformer;
use Pyrodactyl\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 Pterodactyl\Tests\Integration\Api\Application\Nests;
namespace Pyrodactyl\Tests\Integration\Api\Application\Nests;

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

class NestControllerTest extends ApplicationApiIntegrationTestCase
{
Expand All @@ -26,7 +26,7 @@ public function setUp(): void
*/
public function testNestResponse()
{
/** @var \Pterodactyl\Models\Nest[] $nests */
/** @var \Pyrodactyl\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 Pterodactyl\Tests\Integration\Api\Application\Users;
namespace Pyrodactyl\Tests\Integration\Api\Application\Users;

use Illuminate\Support\Str;
use Pterodactyl\Models\User;
use Pyrodactyl\Models\User;
use Illuminate\Http\Response;
use Pterodactyl\Tests\Integration\Api\Application\ApplicationApiIntegrationTestCase;
use Pyrodactyl\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 Pterodactyl\Tests\Integration\Api\Application\Users;
namespace Pyrodactyl\Tests\Integration\Api\Application\Users;

use Pterodactyl\Models\User;
use Pyrodactyl\Models\User;
use Illuminate\Http\Response;
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;
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;

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 Pterodactyl\Tests\Integration\Api\Client;
namespace Pyrodactyl\Tests\Integration\Api\Client;

use Illuminate\Support\Str;
use Pterodactyl\Models\User;
use Pyrodactyl\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 Pterodactyl\Tests\Integration\Api\Client;
namespace Pyrodactyl\Tests\Integration\Api\Client;

use Pterodactyl\Models\User;
use Pyrodactyl\Models\User;
use Illuminate\Http\Response;
use Pterodactyl\Models\ApiKey;
use Pyrodactyl\Models\ApiKey;
use Illuminate\Support\Facades\Event;
use Pterodactyl\Events\ActivityLogged;
use Pyrodactyl\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/pterodactyl/panel/security/advisories/GHSA-pjmh-7xfm-r4x9
* @see https://github.com/pterodactyl/panel/issues/4394
* @see https://github.com/pyrodactyl/panel/security/advisories/GHSA-pjmh-7xfm-r4x9
* @see https://github.com/pyrodactyl/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/pterodactyl/panel/issues/2457
* @see https://github.com/pyrodactyl/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 Pterodactyl\Tests\Integration\Api\Client;
namespace Pyrodactyl\Tests\Integration\Api\Client;

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 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 Illuminate\Support\Collection;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Models\DatabaseHost;
use Pterodactyl\Tests\Integration\TestResponse;
use Pterodactyl\Tests\Integration\IntegrationTestCase;
use Pyrodactyl\Models\Allocation;
use Pyrodactyl\Models\DatabaseHost;
use Pyrodactyl\Tests\Integration\TestResponse;
use Pyrodactyl\Tests\Integration\IntegrationTestCase;
use Illuminate\Database\Eloquent\Model as EloquentModel;
use Pterodactyl\Transformers\Api\Client\BaseClientTransformer;
use Pyrodactyl\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('\\Pterodactyl\\Transformers\\Api\\Client\\%sTransformer', $reflect->getShortName());
$transformer = sprintf('\\Pyrodactyl\\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 Pterodactyl\Tests\Integration\Api\Client;
namespace Pyrodactyl\Tests\Integration\Api\Client;

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

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

/** @var \Pterodactyl\Models\Server[] $servers */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\Models\User[] $users */
$users = User::factory()->times(2)->create();
$users[0]->update(['root_admin' => true]);

/** @var \Pterodactyl\Models\Server[] $servers */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\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 \Pterodactyl\Models\User[] $users */
/** @var \Pyrodactyl\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 Pterodactyl\Tests\Integration\Api\Client;
namespace Pyrodactyl\Tests\Integration\Api\Client;

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

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

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

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

class AllocationAuthorizationTest extends ClientApiIntegrationTestCase
{
Expand Down
Loading

0 comments on commit 5e0da74

Please sign in to comment.