|
29 | 29 | use OCA\Libresign\Service\IdDocsService; |
30 | 30 | use OCA\Libresign\Service\IdentifyMethod\IIdentifyMethod; |
31 | 31 | use OCA\Libresign\Service\IdentifyMethodService; |
| 32 | +use OCA\Libresign\Service\Policy\Model\ResolvedPolicy; |
| 33 | +use OCA\Libresign\Service\Policy\PolicyService; |
32 | 34 | use OCA\Libresign\Service\Policy\PolicyAuthorizationService; |
33 | 35 | use OCA\Libresign\Service\Policy\RequestSignAuthorizationService; |
34 | 36 | use OCA\Libresign\Service\RequestSignatureService; |
@@ -82,6 +84,7 @@ final class AccountServiceTest extends \OCA\Libresign\Tests\Unit\TestCase { |
82 | 84 | private IGroupManager&MockObject $groupManager; |
83 | 85 | private ISubAdmin&MockObject $subAdmin; |
84 | 86 | private PolicyAuthorizationService $policyAuthorizationService; |
| 87 | + private PolicyService&MockObject $policyService; |
85 | 88 | private IdDocsService&MockObject $idDocsService; |
86 | 89 | private SignerElementsService&MockObject $signerElementsService; |
87 | 90 | private UserElementMapper&MockObject $userElementMapper; |
@@ -122,6 +125,17 @@ public function setUp(): void { |
122 | 125 | $this->groupManager = $this->createMock(IGroupManager::class); |
123 | 126 | $this->subAdmin = $this->createMock(ISubAdmin::class); |
124 | 127 | $this->policyAuthorizationService = new PolicyAuthorizationService($this->groupManager, $this->subAdmin); |
| 128 | + $this->policyService = $this->createMock(PolicyService::class); |
| 129 | + $this->policyService->method('resolveForUser')->willReturn( |
| 130 | + (new ResolvedPolicy()) |
| 131 | + ->setPolicyKey('identification_documents') |
| 132 | + ->setEffectiveValue(false) |
| 133 | + ); |
| 134 | + $this->policyService->method('resolve')->willReturn( |
| 135 | + (new ResolvedPolicy()) |
| 136 | + ->setPolicyKey('identification_documents') |
| 137 | + ->setEffectiveValue(false) |
| 138 | + ); |
125 | 139 | $this->idDocsService = $this->createMock(IdDocsService::class); |
126 | 140 | $this->signerElementsService = $this->createMock(SignerElementsService::class); |
127 | 141 | $this->userElementMapper = $this->createMock(UserElementMapper::class); |
@@ -157,6 +171,7 @@ private function getService(): AccountService { |
157 | 171 | $this->pkcs12Handler, |
158 | 172 | $this->groupManager, |
159 | 173 | $this->policyAuthorizationService, |
| 174 | + $this->policyService, |
160 | 175 | $this->idDocsService, |
161 | 176 | $this->signerElementsService, |
162 | 177 | $this->userElementMapper, |
|
0 commit comments