TenantAtlas/apps/platform/tests/Feature/TenantConfiguration/Spec426ExchangeTeamsClaimGuardFeatureTest.php
ahmido f7d06621a0 feat: implement Exchange Teams evidence identity readiness (#493)
Automated PR for spec 426 exchange teams core evidence identity readiness. Includes service changes and coverage/requirement/spec updates from commit fb4dc20c.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #493
2026-07-03 11:43:11 +00:00

33 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\TenantConfigurationResourceType;
use App\Services\TenantConfiguration\ClaimGuard;
use App\Services\TenantConfiguration\ResourceTypeRegistry;
use App\Support\TenantConfiguration\ClaimState;
it('Spec426 persists only internal claim posture for selected Exchange and Teams resource types', function (): void {
app(ResourceTypeRegistry::class)->syncDefaults();
$claimStates = TenantConfigurationResourceType::query()
->whereIn('canonical_type', ['transportRule', 'acceptedDomain', 'appPermissionPolicy', 'meetingPolicy'])
->orderBy('canonical_type')
->get()
->mapWithKeys(fn (TenantConfigurationResourceType $row): array => [
(string) $row->canonical_type => $row->default_claim_state,
])
->all();
expect($claimStates)->toBe([
'acceptedDomain' => ClaimState::InternalOnly,
'appPermissionPolicy' => ClaimState::InternalOnly,
'meetingPolicy' => ClaimState::InternalOnly,
'transportRule' => ClaimState::InternalOnly,
])
->and(app(ClaimGuard::class)->evaluateStatement('Selected Exchange resources are renderable for internal review', internalOperatorOnly: true))
->toBe(ClaimState::InternalOnly)
->and(app(ClaimGuard::class)->evaluateStatement('Microsoft 365 customer-ready evidence', internalOperatorOnly: true))
->toBe(ClaimState::ClaimBlocked);
});