TenantAtlas/tests/Feature/TenantRBAC/BreakGlassRecoveryTest.php
2026-01-27 22:44:54 +01:00

21 lines
587 B
PHP

<?php
use App\Models\AuditLog;
use App\Models\Tenant;
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 = Tenant::factory()->create();
$this->get('/admin/break-glass-recovery')->assertNotFound();
expect(AuditLog::query()->where('tenant_id', $tenant->getKey())->where('action', 'tenant_membership.bootstrap_recover')->exists())
->toBeFalse();
});