mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 14:23:44 +02:00
attempt to fix failing integration tests
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Pterodactyl\Tests\Integration\Api\Client\Server;
|
||||
use Carbon\Carbon;
|
||||
use Lcobucci\JWT\Parser;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Lcobucci\JWT\Signer\Key;
|
||||
use Illuminate\Http\Response;
|
||||
use Pterodactyl\Models\Permission;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha256;
|
||||
@@ -54,7 +55,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase
|
||||
$token = (new Parser)->parse($response->json('data.token'));
|
||||
|
||||
$this->assertTrue(
|
||||
$token->verify(new Sha256, $server->node->getDecryptedKey()),
|
||||
$token->verify(new Sha256, new Key($server->node->getDecryptedKey())),
|
||||
'Failed to validate that the JWT data returned was signed using the Node\'s secret key.'
|
||||
);
|
||||
|
||||
@@ -88,7 +89,7 @@ class WebsocketControllerTest extends ClientApiIntegrationTestCase
|
||||
$token = (new Parser)->parse($response->json('data.token'));
|
||||
|
||||
$this->assertTrue(
|
||||
$token->verify(new Sha256, $server->node->getDecryptedKey()),
|
||||
$token->verify(new Sha256, new Key($server->node->getDecryptedKey())),
|
||||
'Failed to validate that the JWT data returned was signed using the Node\'s secret key.'
|
||||
);
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase
|
||||
|
||||
$this->assertInstanceOf(Database::class, $response);
|
||||
$this->assertSame($response->server_id, $server->id);
|
||||
$this->assertRegExp('/^(u[\d]+_)(\w){10}$/', $username);
|
||||
$this->assertMatchesRegularExpression('/^(u[\d]+_)(\w){10}$/', $username);
|
||||
$this->assertSame($username, $secondUsername);
|
||||
$this->assertSame(24, strlen($password));
|
||||
|
||||
|
||||
@@ -158,9 +158,12 @@ class ServerCreationServiceTest extends IntegrationTestCase
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
/** @var \Pterodactyl\Models\Location $location */
|
||||
$location = Location::factory()->create();
|
||||
|
||||
/** @var \Pterodactyl\Models\Node $node */
|
||||
$node = Node::factory()->create([
|
||||
'location_id' => Location::factory()->create()->id,
|
||||
'location_id' => $location->id,
|
||||
]);
|
||||
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation */
|
||||
|
||||
Reference in New Issue
Block a user