Skip to content

Commit fc39762

Browse files
committed
test(policy): update source expectations for namespaced key
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a0a4ab7 commit fc39762

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/php/Unit/Service/Policy/Runtime/PolicySourceTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public function testLoadSystemPolicyReturnsForcedLayerWhenAppConfigIsSet(): void
4848
->method('getAppValueString')
4949
->willReturnCallback(static function (string $key, string $default) use (&$calls): string {
5050
$calls += 1;
51-
if ($key === 'signature_flow' && $default === '') {
51+
if ($key === 'policy.signature_flow.system' && $default === '') {
5252
return 'ordered_numeric';
5353
}
5454

55-
if ($key === 'signature_flow.allow_child_override' && $default === '0') {
55+
if ($key === 'policy.signature_flow.system.allow_child_override' && $default === '0') {
5656
return '0';
5757
}
5858

@@ -74,7 +74,7 @@ public function testLoadSystemPolicyReturnsInheritableLayerWhenAppConfigMatchesD
7474
$this->appConfig
7575
->expects($this->once())
7676
->method('getAppValueString')
77-
->with('signature_flow', '')
77+
->with('policy.signature_flow.system', '')
7878
->willReturn('');
7979

8080
$source = $this->getSource();
@@ -177,7 +177,7 @@ public function testSaveSystemPolicyDeletesAppConfigWhenValueMatchesDefault(): v
177177
$source = $this->getSource();
178178
$source->saveSystemPolicy('signature_flow', 'none');
179179

180-
$this->assertSame(['signature_flow', 'signature_flow.allow_child_override'], $deletedKeys);
180+
$this->assertSame(['policy.signature_flow.system', 'policy.signature_flow.system.allow_child_override'], $deletedKeys);
181181
}
182182

183183
public function testSaveSystemPolicyNormalizesAndPersistsAppConfigValue(): void {
@@ -194,8 +194,8 @@ public function testSaveSystemPolicyNormalizesAndPersistsAppConfigValue(): void
194194
$source->saveSystemPolicy('signature_flow', 2, true);
195195

196196
$this->assertSame([
197-
'signature_flow' => 'ordered_numeric',
198-
'signature_flow.allow_child_override' => '1',
197+
'policy.signature_flow.system' => 'ordered_numeric',
198+
'policy.signature_flow.system.allow_child_override' => '1',
199199
], $savedValues);
200200
}
201201

@@ -206,11 +206,11 @@ public function testLoadSystemPolicyRespectsPersistedAllowChildOverride(): void
206206
->method('getAppValueString')
207207
->willReturnCallback(static function (string $key, string $default) use (&$calls): string {
208208
$calls += 1;
209-
if ($key === 'signature_flow' && $default === '') {
209+
if ($key === 'policy.signature_flow.system' && $default === '') {
210210
return 'ordered_numeric';
211211
}
212212

213-
if ($key === 'signature_flow.allow_child_override' && $default === '0') {
213+
if ($key === 'policy.signature_flow.system.allow_child_override' && $default === '0') {
214214
return '1';
215215
}
216216

0 commit comments

Comments
 (0)