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

29 lines
842 B
PHP

<?php
declare(strict_types=1);
use App\Filament\Pages\TenantDiagnostics;
use App\Models\ManagedEnvironment;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
uses(RefreshDatabase::class);
it('does not use external GUID where internal tenant id is required (diagnostics page loads)', function () {
[$user, $tenant] = createUserWithTenant(role: 'owner');
// Ensure the tenant has a GUID-like external identifier (this is the tenant route key).
$tenant->forceFill([
'external_id' => '00000000-0000-0000-0000-000000000123',
'managed_environment_id' => '00000000-0000-0000-0000-000000000123',
])->save();
$this->actingAs($user);
Filament::setTenant($tenant, true);
Livewire::test(TenantDiagnostics::class)
->assertSuccessful();
});