actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $connection = ProviderConnection::factory()->create([ 'tenant_id' => $tenant->getKey(), 'provider' => 'microsoft', 'entra_tenant_id' => fake()->uuid(), ]); $starter = app(StartVerification::class); $first = $starter->providerConnectionCheck( tenant: $tenant, connection: $connection, initiator: $user, ); /** @var OperationRun $firstRun */ $firstRun = $first->run->refresh(); app(OperationRunService::class)->updateRun( $firstRun, status: OperationRunStatus::Completed->value, outcome: OperationRunOutcome::Succeeded->value, ); $second = $starter->providerConnectionCheck( tenant: $tenant, connection: $connection, initiator: $user, ); expect($second->status)->toBe('started'); expect($second->run->getKey())->not->toBe($firstRun->getKey()); expect(OperationRun::query() ->where('tenant_id', $tenant->getKey()) ->where('type', 'provider.connection.check') ->count())->toBe(2); Queue::assertPushed(ProviderConnectionHealthCheckJob::class, 2); });