TenantAtlas/tests/Unit/Inventory/InventorySelectionHasherTest.php
2026-01-07 15:51:47 +01:00

24 lines
750 B
PHP

<?php
use App\Services\Inventory\InventorySelectionHasher;
it('computes the same selection_hash regardless of array ordering', function () {
$hasher = app(InventorySelectionHasher::class);
$payloadA = [
'policy_types' => ['deviceCompliancePolicy', 'deviceConfiguration'],
'categories' => ['Compliance', 'Configuration'],
'include_foundations' => true,
'include_dependencies' => false,
];
$payloadB = [
'include_dependencies' => false,
'include_foundations' => true,
'categories' => ['Configuration', 'Compliance'],
'policy_types' => ['deviceConfiguration', 'deviceCompliancePolicy'],
];
expect($hasher->hash($payloadA))->toBe($hasher->hash($payloadB));
});