checkArcadiaConformity(); // THEN expect($result->isConform())->toBeTrue() ->and($result->status)->toBe(HealthStatus::HEALTHY) ->and(count($result->checks))->toBe(count(Migrator::DEFINITIONS)); foreach ($result->checks as $check) { expect($check->status)->toBe(ComponentStatus::UP) ->and($check->errorMessage)->toBeNull(); } }); it('returns unhealthy status with captured dissonance when tables like ADDITIF or FAM_VENTE are missing or renamed', function (): void { // GIVEN $storageConfig = resolve(ArcadiaStorageConfig::class); $checker = new LaravelSystemHealthChecker($storageConfig); // Drop ADDITIF and FAM_VENTE to simulate table rename/removal in Oracle schema Schema::connection($storageConfig->databaseConnection)->dropIfExists('ADDITIF'); Schema::connection($storageConfig->databaseConnection)->dropIfExists('FAM_VENTE'); // WHEN $result = $checker->checkArcadiaConformity(); // THEN expect($result->isConform())->toBeFalse() ->and($result->hasDissonances())->toBeTrue() ->and($result->status)->toBe(HealthStatus::UNHEALTHY); $additifCheck = collect($result->checks)->firstWhere('name', 'additif'); $famVenteCheck = collect($result->checks)->firstWhere('name', 'fam_vente'); $marqueCheck = collect($result->checks)->firstWhere('name', 'marque'); expect($additifCheck)->not->toBeNull() ->and($additifCheck->status)->toBe(ComponentStatus::DOWN) ->and($additifCheck->errorMessage)->not->toBeNull() ->and($famVenteCheck)->not->toBeNull() ->and($famVenteCheck->status)->toBe(ComponentStatus::DOWN) ->and($famVenteCheck->errorMessage)->not->toBeNull() ->and($marqueCheck)->not->toBeNull() ->and($marqueCheck->status)->toBe(ComponentStatus::UP); }); });