TenantAtlas/apps/platform/tests/Unit/Factories/TenantFactoryTest.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

28 lines
881 B
PHP

<?php
declare(strict_types=1);
use App\Models\ManagedEnvironment;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
it('can create tenants without provisioning a workspace graph when the minimal state is explicit', function (): void {
$tenant = ManagedEnvironment::factory()->minimal()->create();
expect($tenant->workspace_id)->toBeNull();
});
it('keeps the default tenant factory path workspace-ready for existing callers', function (): void {
$tenant = ManagedEnvironment::factory()->create();
expect($tenant->workspace_id)->not->toBeNull();
});
it('restores default workspace provisioning after an explicit minimal tenant is created', function (): void {
ManagedEnvironment::factory()->minimal()->create();
$tenant = ManagedEnvironment::factory()->create();
expect($tenant->workspace_id)->not->toBeNull();
});