30 lines
1.1 KiB
PHP
30 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Services\TenantConfiguration\CoverageCaptureOutcomeSummarizer;
|
|
use App\Support\OperationCatalog;
|
|
use App\Support\OperationRunOutcome;
|
|
|
|
it('summarizes capture outcomes with existing canonical operation summary keys', function (): void {
|
|
$result = (new CoverageCaptureOutcomeSummarizer)->summarize([
|
|
['canonical_type' => 'deviceAndAppManagementAssignmentFilter', 'outcome' => 'captured', 'item_count' => 1],
|
|
['canonical_type' => 'roleScopeTag', 'outcome' => 'capture_blocked_beta', 'item_count' => 0],
|
|
['canonical_type' => 'notificationMessageTemplate', 'outcome' => 'capture_failed', 'reason_code' => 'graph_response_failed_503'],
|
|
]);
|
|
|
|
expect($result['summary_counts'])->toBe([
|
|
'total' => 3,
|
|
'processed' => 3,
|
|
'succeeded' => 1,
|
|
'skipped' => 1,
|
|
'failed' => 1,
|
|
'errors_recorded' => 1,
|
|
])
|
|
->and($result['run_outcome'])->toBe(OperationRunOutcome::PartiallySucceeded->value);
|
|
|
|
foreach (array_keys($result['summary_counts']) as $key) {
|
|
expect(OperationCatalog::allowedSummaryKeys())->toContain($key);
|
|
}
|
|
});
|