2018-03-04 22:30:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Tests\Integration;
|
|
|
|
|
2021-01-23 20:09:16 +00:00
|
|
|
use Carbon\CarbonImmutable;
|
2022-10-14 16:59:20 +00:00
|
|
|
use Carbon\CarbonInterface;
|
2021-01-23 20:09:16 +00:00
|
|
|
use Pterodactyl\Tests\TestCase;
|
2022-06-18 18:21:20 +00:00
|
|
|
use Illuminate\Support\Facades\Event;
|
|
|
|
use Pterodactyl\Events\ActivityLogged;
|
|
|
|
use Pterodactyl\Tests\Assertions\AssertsActivityLogged;
|
2021-01-23 20:09:16 +00:00
|
|
|
use Pterodactyl\Tests\Traits\Integration\CreatesTestModels;
|
2018-03-04 22:30:16 +00:00
|
|
|
|
|
|
|
abstract class IntegrationTestCase extends TestCase
|
|
|
|
{
|
2020-06-27 17:35:02 +00:00
|
|
|
use CreatesTestModels;
|
2022-06-18 18:21:20 +00:00
|
|
|
use AssertsActivityLogged;
|
2020-06-27 17:35:02 +00:00
|
|
|
|
2022-05-30 00:39:51 +00:00
|
|
|
protected $defaultHeaders = [
|
|
|
|
'Accept' => 'application/json',
|
|
|
|
];
|
|
|
|
|
2022-06-18 18:21:20 +00:00
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
Event::fake(ActivityLogged::class);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
{
|
2022-10-14 16:59:20 +00:00
|
|
|
return CarbonImmutable::createFromFormat(CarbonInterface::DEFAULT_TO_STRING_FORMAT, $timestamp)
|
2022-12-15 00:05:46 +00:00
|
|
|
->setTimezone('UTC')
|
2022-10-14 16:59:20 +00:00
|
|
|
->toAtomString();
|
2018-03-04 22:30:16 +00:00
|
|
|
}
|
|
|
|
}
|