Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/tests/Integration/IntegrationTestCase.php
7458 views
1
<?php
2
3
namespace Pterodactyl\Tests\Integration;
4
5
use Carbon\CarbonImmutable;
6
use Carbon\CarbonInterface;
7
use Pterodactyl\Tests\TestCase;
8
use Illuminate\Support\Facades\Event;
9
use Pterodactyl\Events\ActivityLogged;
10
use Pterodactyl\Tests\Assertions\AssertsActivityLogged;
11
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
12
use Pterodactyl\Transformers\Api\Application\BaseTransformer;
13
14
abstract class IntegrationTestCase extends TestCase
15
{
16
use CreatesTestModels;
17
use AssertsActivityLogged;
18
19
protected array $connectionsToTransact = ['mysql'];
20
21
protected $defaultHeaders = [
22
'Accept' => 'application/json',
23
];
24
25
public function setUp(): void
26
{
27
parent::setUp();
28
29
Event::fake(ActivityLogged::class);
30
}
31
32
/**
33
* Return an ISO-8601 formatted timestamp to use in the API response.
34
*/
35
protected function formatTimestamp(string $timestamp): string
36
{
37
return CarbonImmutable::createFromFormat(CarbonInterface::DEFAULT_TO_STRING_FORMAT, $timestamp)
38
->setTimezone(BaseTransformer::RESPONSE_TIMEZONE)
39
->toAtomString();
40
}
41
}
42
43