misc_pterodactyl-panel/tests/Integration/IntegrationTestCase.php

26 lines
740 B
PHP
Raw Normal View History

2018-03-04 22:30:16 +00:00
<?php
namespace Pterodactyl\Tests\Integration;
use Carbon\CarbonImmutable;
use Pterodactyl\Tests\TestCase;
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
2018-03-04 22:30:16 +00:00
use Pterodactyl\Transformers\Api\Application\BaseTransformer;
abstract class IntegrationTestCase extends TestCase
{
use CreatesTestModels;
2022-05-29 21:07:34 +00:00
protected array $connectionsToTransact = ['mysql'];
2018-03-04 22:30:16 +00:00
/**
* Return an ISO-8601 formatted timestamp to use in the API response.
*/
protected function formatTimestamp(string $timestamp): string
{
return CarbonImmutable::createFromFormat(CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $timestamp)
2018-03-04 22:30:16 +00:00
->setTimezone(BaseTransformer::RESPONSE_TIMEZONE)
->toIso8601String();
}
}