TenantAtlas/apps/platform/tests/Unit/Factories/ProviderConnectionFactoryTest.php
2026-04-16 15:57:39 +02:00

21 lines
700 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('can opt into a heavier provider graph with a checked-in factory state', function (): void {
$connection = ProviderConnection::factory()->withCredential()->create();
expect($connection->credential()->exists())->toBeTrue()
->and($connection->refresh()->is_default)->toBeTrue();
});