1212use OCA \Libresign \Service \Policy \Contract \IPolicyDefinitionProvider ;
1313use OCA \Libresign \Service \Policy \Model \PolicyContext ;
1414use OCA \Libresign \Service \Policy \Model \PolicySpec ;
15+ use OCA \Libresign \Service \Policy \Provider \DocMdp \DocMdpPolicy ;
1516use OCA \Libresign \Service \Policy \Provider \Signature \SignatureFlowPolicy ;
1617use OCA \Libresign \Service \Policy \Runtime \PolicyRegistry ;
1718use PHPUnit \Framework \TestCase ;
@@ -27,7 +28,19 @@ public function testRegistryReturnsSignatureFlowDefinition(): void {
2728 $ this ->assertSame (SignatureFlowPolicy::KEY , $ definition ->key ());
2829 $ this ->assertSame ('none ' , $ definition ->defaultSystemValue ());
2930 $ this ->assertSame (['none ' , 'parallel ' , 'ordered_numeric ' ], $ definition ->allowedValues (new PolicyContext ()));
30- $ this ->assertSame ('ordered_numeric ' , $ definition ->normalizeValue (2 ));
31+ $ this ->assertSame ('ordered_numeric ' , $ definition ->normalizeValue ('ordered_numeric ' ));
32+ }
33+
34+ public function testRegistryReturnsDocMdpDefinition (): void {
35+ $ container = $ this ->createMock (ContainerInterface::class);
36+ $ container ->method ('get ' )->with (DocMdpPolicy::class)->willReturn (new DocMdpPolicy ());
37+ $ registry = new PolicyRegistry ($ container );
38+ $ definition = $ registry ->get (DocMdpPolicy::KEY );
39+
40+ $ this ->assertSame (DocMdpPolicy::KEY , $ definition ->key ());
41+ $ this ->assertSame (0 , $ definition ->defaultSystemValue ());
42+ $ this ->assertSame ([0 , 1 , 2 , 3 ], $ definition ->allowedValues (new PolicyContext ()));
43+ $ this ->assertSame (2 , $ definition ->normalizeValue (2 ));
3144 }
3245
3346 public function testRegistryThrowsForUnknownPolicy (): void {
0 commit comments