Skip to content

Commit 5910d3f

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

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
@@ -2660,7 +2660,6 @@ public function testCreateSignedFileRunsAsOwnerAndRestoresSession(): void {
26602660
public function testSignSequentiallyRunsEngineSignAsOwnerAndRestoresSession(): void {
26612661
$service = $this->getService([
26622662
'validateDocMdpAllowsSignatures',
2663-
'getFileToSign',
26642663
'getEngine',
26652664
'computeHash',
26662665
'updateSignRequest',
@@ -2700,12 +2699,13 @@ public function testSignSequentiallyRunsEngineSignAsOwnerAndRestoresSession(): v
27002699

27012700
$service->expects($this->once())
27022701
->method('validateDocMdpAllowsSignatures');
2703-
$service->expects($this->once())
2704-
->method('getFileToSign')
2705-
->willReturn($fileToSign);
27062702
$service->expects($this->exactly(2))
27072703
->method('getEngine')
2708-
->willReturn($engine);
2704+
->willReturnCallback(function () use ($service, $fileToSign, $engine) {
2705+
$fileToSignProperty = new \ReflectionProperty(SignFileService::class, 'fileToSign');
2706+
$fileToSignProperty->setValue($service, $fileToSign);
2707+
return $engine;
2708+
});
27092709
$service->expects($this->once())
27102710
->method('computeHash')
27112711
->with($signedFile)

0 commit comments

Comments
 (0)