mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 17:12:30 +01:00
cbcf62086f
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Pterodactyl\Tests\Integration;
|
|
|
|
use Carbon\CarbonImmutable;
|
|
use Carbon\CarbonInterface;
|
|
use Pterodactyl\Tests\TestCase;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Pterodactyl\Events\ActivityLogged;
|
|
use Pterodactyl\Tests\Assertions\AssertsActivityLogged;
|
|
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
|
|
use Pterodactyl\Transformers\Api\Application\BaseTransformer;
|
|
|
|
abstract class IntegrationTestCase extends TestCase
|
|
{
|
|
use CreatesTestModels;
|
|
use AssertsActivityLogged;
|
|
|
|
protected array $connectionsToTransact = ['mysql'];
|
|
|
|
protected $defaultHeaders = [
|
|
'Accept' => 'application/json',
|
|
];
|
|
|
|
public function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
Event::fake(ActivityLogged::class);
|
|
}
|
|
|
|
/**
|
|
* Return an ISO-8601 formatted timestamp to use in the API response.
|
|
*/
|
|
protected function formatTimestamp(string $timestamp): string
|
|
{
|
|
return CarbonImmutable::createFromFormat(CarbonInterface::DEFAULT_TO_STRING_FORMAT, $timestamp)
|
|
->setTimezone(BaseTransformer::RESPONSE_TIMEZONE)
|
|
->toAtomString();
|
|
}
|
|
}
|