isConform())->toBeTrue() ->and($result->hasDissonances())->toBeFalse() ->and($result->checksum())->toBe('healthy') ->and($checks[0]->isUp())->toBeTrue(); }); it('evaluates unhealthy state and generates deterministic SHA-256 checksum for diffing', function (): void { // GIVEN $date = new \DateTimeImmutable('2026-08-27 15:00:00 UTC'); $checks1 = [ new DirectoryConformityCheck('brands', ComponentStatus::DOWN, 'MARQUE', 0, 'Column LIB_MARQ not found'), new DirectoryConformityCheck('employees', ComponentStatus::UP, 'RU_PERSONNE_SIRH', 5), ]; $checks2 = [ new DirectoryConformityCheck('employees', ComponentStatus::UP, 'RU_PERSONNE_SIRH', 5), new DirectoryConformityCheck('brands', ComponentStatus::DOWN, 'MARQUE', 0, 'Column LIB_MARQ not found'), ]; $checks3 = [ new DirectoryConformityCheck('brands', ComponentStatus::DOWN, 'MARQUE', 0, 'Table MARQUE not found'), new DirectoryConformityCheck('employees', ComponentStatus::UP, 'RU_PERSONNE_SIRH', 5), ]; $result1 = new ArcadiaConformityResult(HealthStatus::UNHEALTHY, $date, $checks1); $result2 = new ArcadiaConformityResult(HealthStatus::UNHEALTHY, $date, $checks2); $result3 = new ArcadiaConformityResult(HealthStatus::UNHEALTHY, $date, $checks3); // WHEN $checksum1 = $result1->checksum(); $checksum2 = $result2->checksum(); $checksum3 = $result3->checksum(); // THEN expect($result1->isConform())->toBeFalse() ->and($result1->hasDissonances())->toBeTrue() ->and($checksum1)->toBe($checksum2) // Deterministic regardless of order ->and($checksum1)->not->toBe($checksum3) // Changes when error changes ->and(strlen($checksum1))->toBe(64); // Valid SHA-256 length }); });