Skip to content

Commit 50b66c4

Browse files
committed
fix: unit tests
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 3beca7f commit 50b66c4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tests/php/Unit/Service/RequestSignatureServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setUp(): void {
9090
$this->docMdpConfigService = $this->createMock(DocMdpConfigService::class);
9191
}
9292

93-
private function getService(?SequentialSigningService $sequentialSigningService = null): RequestSignatureService {
93+
private function getService(): RequestSignatureService {
9494
return new RequestSignatureService(
9595
$this->l10n,
9696
$this->identifyMethodService,
@@ -107,7 +107,7 @@ private function getService(?SequentialSigningService $sequentialSigningService
107107
$this->client,
108108
$this->docMdpHandler,
109109
$this->loggerInterface,
110-
$sequentialSigningService ?? $this->sequentialSigningService,
110+
$this->sequentialSigningService,
111111
$this->appConfig,
112112
$this->eventDispatcher,
113113
$this->fileStatusService,

tests/php/Unit/Service/SignFileServiceTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public function testSignGenerateASha256OfSignedFile(string $signedContent):void
284284
$nextcloudFile = $this->createMock(\OCP\Files\File::class);
285285
$nextcloudFile->method('getContent')->willReturn($signedContent);
286286
$service->method('getNextcloudFile')->willReturn($nextcloudFile);
287-
$service->method('validateDocMdpAllowsSignatures')->willReturn(null);
287+
$service->method('validateDocMdpAllowsSignatures');
288288

289289
$pkcs12Handler = $this->createMock(Pkcs12Handler::class);
290290
$pkcs12Handler->method('sign')->willReturn($nextcloudFile);
@@ -340,7 +340,7 @@ public function testUpdateDatabaseWhenSign(): void {
340340
$nextcloudFile = $this->createMock(\OCP\Files\File::class);
341341
$nextcloudFile->method('getContent')->willReturn('pdf content');
342342
$service->method('getNextcloudFile')->willReturn($nextcloudFile);
343-
$service->method('validateDocMdpAllowsSignatures')->willReturn(null);
343+
$service->method('validateDocMdpAllowsSignatures');
344344

345345
$this->fileMapper->expects($this->once())->method('update');
346346
$this->signRequestMapper->expects($this->once())->method('update');
@@ -381,7 +381,7 @@ public function testDispatchEventWhenSign(): void {
381381
$nextcloudFile = $this->createMock(\OCP\Files\File::class);
382382
$nextcloudFile->method('getContent')->willReturn('pdf content');
383383
$service->method('getNextcloudFile')->willReturn($nextcloudFile);
384-
$service->method('validateDocMdpAllowsSignatures')->willReturn(null);
384+
$service->method('validateDocMdpAllowsSignatures');
385385

386386
$this->eventDispatcher
387387
->expects($this->once())

0 commit comments

Comments
 (0)