TenantAtlas/apps/platform/tests/Unit/Services/Baselines/Matching/FoundationCoverageResolverTest.php
Ahmed Darrazi dd9512ed10
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m12s
feat(baselines): implement baseline matching canonicalization
Replaced legacy tenant and environment bindings in the BaselineDriftEngine with the new ProviderResourceIdentity framework as defined in Spec 382.
2026-06-16 00:48:01 +02:00

25 lines
1.0 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_not_policy_backed')
->and($canonicalOnly['coverage'])->toBe('canonical_only')
->and($canonicalOnly['identity_kind'])->toBe(ResourceIdentity::CanonicalBuiltin)
->and($unsupported['coverage'])->toBe('unsupported')
->and($unsupported['reason_code'])->toBe('unsupported_subject');
});