TenantAtlas/apps/platform/tests/Feature/Guards/AdminWorkspaceRoutesGuardTest.php
Ahmed Darrazi 1123b122d9
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 7m13s
feat: cut over tenant core to managed environments
2026-05-07 08:35:42 +02:00

30 lines
855 B
PHP

<?php
declare(strict_types=1);
use App\Models\PlatformUser;
use App\Models\ManagedEnvironment;
it('returns 404 for platform-guard sessions on admin workspace-scoped routes', function (): void {
$tenant = ManagedEnvironment::factory()->create();
$workspace = $tenant->workspace;
expect($workspace)->not->toBeNull();
$platformUser = PlatformUser::factory()->create();
$workspaceRouteKey = (string) ($workspace->slug ?? $workspace->getKey());
$this->actingAs($platformUser, 'platform')
->get("/admin/w/{$workspaceRouteKey}/ping")
->assertNotFound();
});
it('returns 404 for platform-guard sessions on the workspace overview home', function (): void {
$platformUser = PlatformUser::factory()->create();
$this->actingAs($platformUser, 'platform')
->get('/admin')
->assertNotFound();
});