TenantAtlas/apps/platform/tests/Unit/Services/Baselines/Matching/FoundationCoverageResolverTest.php
ahmido ea77c8c718 feat(baselines): implement baseline compare result semantics (#454)
Implemented deterministic Baseline Result Semantics (Spec 383), introducing CompareSubjectResult and CompareEvidenceResult. Replaced generic arrays with strict Data Transfer Objects for Baseline engine output.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #454
2026-06-16 20:20:27 +00:00

26 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Services\Baselines\Matching\FoundationCoverageResolver;
use App\Support\Resources\ResourceIdentity;
it('classifies foundation inventory-only and canonical-only coverage through the existing support contract', function (): void {
$resolver = app(FoundationCoverageResolver::class);
$inventoryOnly = $resolver->coverageFor('roleScopeTag');
$canonicalOnly = $resolver->coverageFor(
'roleScopeTag',
ResourceIdentity::canonicalBuiltin('fake-provider', 'scope-tag', 'default'),
);
$unsupported = $resolver->coverageFor('intuneRoleAssignment');
expect($inventoryOnly['coverage'])->toBe('inventory_only')
->and($inventoryOnly['reason_code'])->toBe('foundation_inventory_only')
->and($canonicalOnly['coverage'])->toBe('canonical_only')
->and($canonicalOnly['reason_code'])->toBe('foundation_canonical_only')
->and($canonicalOnly['identity_kind'])->toBe(ResourceIdentity::CanonicalBuiltin)
->and($unsupported['coverage'])->toBe('unsupported')
->and($unsupported['reason_code'])->toBe('unsupported_resource_class');
});