TenantAtlas/apps/platform/tests/Feature/TenantRBAC/BreakGlassRecoveryTest.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

21 lines
624 B
PHP

<?php
use App\Models\AuditLog;
use App\Models\ManagedEnvironment;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
it('does not allow legacy platform-superadmin break-glass recovery flow', function () {
$user = User::factory()->create();
$this->actingAs($user);
$tenant = ManagedEnvironment::factory()->create();
$this->get('/admin/break-glass-recovery')->assertNotFound();
expect(AuditLog::query()->where('managed_environment_id', $tenant->getKey())->where('action', 'tenant_membership.bootstrap_recover')->exists())
->toBeFalse();
});