TenantAtlas/apps/platform/tests/Unit/Factories/ProviderConnectionFactoryTest.php
2026-04-16 19:27:47 +02:00

29 lines
1006 B
PHP

<?php
declare(strict_types=1);
use App\Models\ProviderConnection;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
it('keeps the explicit minimal provider connection state free of credential side effects', function (): void {
$connection = ProviderConnection::factory()->minimal()->create();
expect($connection->credential()->exists())->toBeFalse();
});
it('keeps the explicit standard provider connection state healthy without credential side effects', function (): void {
$connection = ProviderConnection::factory()->standard()->create();
expect($connection->is_default)->toBeTrue()
->and($connection->credential()->exists())->toBeFalse();
});
it('can opt into a heavier provider graph with a checked-in full factory state', function (): void {
$connection = ProviderConnection::factory()->full()->create();
expect($connection->credential()->exists())->toBeTrue()
->and($connection->refresh()->is_default)->toBeTrue();
});