<?php

declare(strict_types=1);

it('keeps baseline capture/compare hashing on the InventoryMetaContract engine', function (): void {
    $compareJob = file_get_contents(base_path('app/Jobs/CompareBaselineToTenantJob.php'));
    expect($compareJob)->toBeString();
    expect($compareJob)->toContain('CurrentStateHashResolver');
    expect($compareJob)->toContain('compareStrategyRegistry->select(');
    expect($compareJob)->toContain('compareStrategyRegistry->resolve(');
    expect($compareJob)->toContain('$strategy->compare(');
    expect($compareJob)->not->toContain('computeDrift(');
    expect($compareJob)->not->toContain('->fingerprint(');
    expect($compareJob)->not->toContain('::fingerprint(');

    $captureJob = file_get_contents(base_path('app/Jobs/CaptureBaselineSnapshotJob.php'));
    expect($captureJob)->toBeString();
    expect($captureJob)->toContain('InventoryMetaContract');
    expect($captureJob)->toContain('CurrentStateHashResolver');
    expect($captureJob)->not->toContain('->fingerprint(');
    expect($captureJob)->not->toContain('::fingerprint(');

    $metaProvider = file_get_contents(base_path('app/Services/Baselines/Evidence/MetaEvidenceProvider.php'));
    expect($metaProvider)->toBeString();
    expect($metaProvider)->toContain('hashItemContent');
    expect($metaProvider)->not->toContain('->fingerprint(');
    expect($metaProvider)->not->toContain('::fingerprint(');

    $identity = file_get_contents(base_path('app/Services/Baselines/BaselineSnapshotIdentity.php'));
    expect($identity)->toBeString();
    expect($identity)->toContain('InventoryMetaContract');
    expect($identity)->toContain('hashNormalized');
    expect($identity)->not->toContain('fingerprint(');
});
