Files
fotospiel-app/tests/Feature/Tenant/EventJoinTokenTtlPolicyTest.php
Codex Agent 88012c35bd
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
Add join token TTL policy and Live Show link sharing
2026-01-05 21:11:36 +01:00

32 lines
863 B
PHP

<?php
namespace Tests\Feature\Tenant;
use App\Models\Event;
use Carbon\Carbon;
class EventJoinTokenTtlPolicyTest extends TenantTestCase
{
public function test_join_token_defaults_to_policy_ttl_when_expiry_missing(): void
{
Carbon::setTestNow(Carbon::parse('2026-01-05 12:00:00'));
$event = Event::factory()
->for($this->tenant)
->create([
'name' => ['de' => 'Token TTL Test', 'en' => 'Token TTL Test'],
'slug' => 'token-ttl-test',
]);
$response = $this->authenticatedRequest('POST', "/api/v1/tenant/events/{$event->slug}/join-tokens");
$response->assertCreated();
$expectedExpiry = now()->addDays(7)->toIso8601String();
$this->assertSame($expectedExpiry, $response->json('data.expires_at'));
Carbon::setTestNow();
}
}