Skip to content

Commit 6f627ca

Browse files
committed
test: align owner session signing regression
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent cc07a6f commit 6f627ca

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/php/Unit/Service/SignFileServiceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,6 @@ public function testCreateSignedFileRunsAsOwnerAndRestoresSession(): void {
27242724
public function testSignSequentiallyRunsEngineSignAsOwnerAndRestoresSession(): void {
27252725
$service = $this->getService([
27262726
'validateDocMdpAllowsSignatures',
2727-
'getFileToSign',
27282727
'getEngine',
27292728
'computeHash',
27302729
'updateSignRequest',
@@ -2764,12 +2763,13 @@ public function testSignSequentiallyRunsEngineSignAsOwnerAndRestoresSession(): v
27642763

27652764
$service->expects($this->once())
27662765
->method('validateDocMdpAllowsSignatures');
2767-
$service->expects($this->once())
2768-
->method('getFileToSign')
2769-
->willReturn($fileToSign);
27702766
$service->expects($this->exactly(2))
27712767
->method('getEngine')
2772-
->willReturn($engine);
2768+
->willReturnCallback(function () use ($service, $fileToSign, $engine) {
2769+
$fileToSignProperty = new \ReflectionProperty(SignFileService::class, 'fileToSign');
2770+
$fileToSignProperty->setValue($service, $fileToSign);
2771+
return $engine;
2772+
});
27732773
$service->expects($this->once())
27742774
->method('computeHash')
27752775
->with($signedFile)

0 commit comments

Comments
 (0)