Skip to content

Commit 5cc22a8

Browse files
committed
test(policy): cover policy spec resolution mode
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 3431b14 commit 5cc22a8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/php/Unit/Service/Policy/Model/PolicySpecTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,22 @@ public function testDefaultStorageKeysFallbackToPolicyKey(): void {
2020
allowedValues: ['none', 'parallel', 'ordered_numeric'],
2121
);
2222

23+
$this->assertSame(PolicySpec::RESOLUTION_MODE_RESOLVED, $spec->resolutionMode());
2324
$this->assertSame('signature_flow', $spec->getAppConfigKey());
2425
$this->assertSame('policy.signature_flow', $spec->getUserPreferenceKey());
2526
}
2627

28+
public function testResolutionModeMayBeConfiguredPerPolicy(): void {
29+
$spec = new PolicySpec(
30+
key: 'signature_flow',
31+
defaultSystemValue: 'none',
32+
allowedValues: ['none', 'parallel', 'ordered_numeric'],
33+
resolutionMode: PolicySpec::RESOLUTION_MODE_VALUE_CHOICE,
34+
);
35+
36+
$this->assertSame(PolicySpec::RESOLUTION_MODE_VALUE_CHOICE, $spec->resolutionMode());
37+
}
38+
2739
public function testNormalizerAndValidatorAreApplied(): void {
2840
$spec = new PolicySpec(
2941
key: 'signature_flow',

0 commit comments

Comments
 (0)