stage 1 of oauth removal, switch to sanctum pat tokens

This commit is contained in:
Codex Agent
2025-11-06 20:35:58 +01:00
parent c9783bd57b
commit 776da57ca9
47 changed files with 1571 additions and 2555 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class TenantAdminEntryTest extends TestCase
{
use RefreshDatabase;
public function test_guest_is_redirected_to_admin_start(): void
{
$response = $this->get('/event-admin/dashboard');
$response->assertRedirect('/event-admin/start');
}
public function test_tenant_admin_can_access_admin_shell(): void
{
$user = User::factory()->create([
'role' => 'tenant_admin',
]);
$response = $this->actingAs($user)->get('/event-admin/dashboard');
$response->assertOk();
$response->assertViewIs('admin');
}
public function test_regular_user_is_redirected_to_packages(): void
{
$user = User::factory()->create([
'role' => 'user',
]);
$response = $this->actingAs($user)->get('/event-admin/dashboard');
$response->assertRedirect('/packages');
}
}