Path: blob/1.0-develop/tests/Integration/IntegrationTestCase.php
7458 views
<?php12namespace Pterodactyl\Tests\Integration;34use Carbon\CarbonImmutable;5use Carbon\CarbonInterface;6use Pterodactyl\Tests\TestCase;7use Illuminate\Support\Facades\Event;8use Pterodactyl\Events\ActivityLogged;9use Pterodactyl\Tests\Assertions\AssertsActivityLogged;10use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;11use Pterodactyl\Transformers\Api\Application\BaseTransformer;1213abstract class IntegrationTestCase extends TestCase14{15use CreatesTestModels;16use AssertsActivityLogged;1718protected array $connectionsToTransact = ['mysql'];1920protected $defaultHeaders = [21'Accept' => 'application/json',22];2324public function setUp(): void25{26parent::setUp();2728Event::fake(ActivityLogged::class);29}3031/**32* Return an ISO-8601 formatted timestamp to use in the API response.33*/34protected function formatTimestamp(string $timestamp): string35{36return CarbonImmutable::createFromFormat(CarbonInterface::DEFAULT_TO_STRING_FORMAT, $timestamp)37->setTimezone(BaseTransformer::RESPONSE_TIMEZONE)38->toAtomString();39}40}414243