diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-10-25 12:33:56 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-23 09:28:59 +0100 |
commit | 065531570d8466d305c51bcfc2b09713057f10a7 (patch) | |
tree | 4bbbe81519004daf28f550ebb7842cf43a14eebd /tests | |
parent | bb9c099e42757727604e87caedf86b63033e3c0d (diff) | |
download | nextcloud-server-065531570d8466d305c51bcfc2b09713057f10a7.tar.gz nextcloud-server-065531570d8466d305c51bcfc2b09713057f10a7.zip |
Fix Encryption tests on PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Encryption/DecryptAllTest.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index dc7c40f0fe2..90ff045a9b9 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -81,8 +81,12 @@ class DecryptAllTest extends TestCase { $this->userInterface = $this->getMockBuilder(UserInterface::class) ->disableOriginalConstructor()->getMock(); + /* We need format method to return a string */ + $outputFormatter = $this->createMock(OutputFormatterInterface::class); + $outputFormatter->method('format')->willReturn('foo'); + $this->outputInterface->expects($this->any())->method('getFormatter') - ->willReturn($this->createMock(OutputFormatterInterface::class)); + ->willReturn($outputFormatter); $this->instance = new DecryptAll($this->encryptionManager, $this->userManager, $this->view); @@ -298,10 +302,15 @@ class DecryptAllTest extends TestCase { ->method('decryptFile') ->with('/user1/files/foo/subfile'); + + /* We need format method to return a string */ + $outputFormatter = $this->createMock(OutputFormatterInterface::class); + $outputFormatter->method('format')->willReturn('foo'); + $output = $this->createMock(OutputInterface::class); $output->expects($this->any()) ->method('getFormatter') - ->willReturn($this->createMock(OutputFormatterInterface::class)); + ->willReturn($outputFormatter); $progressBar = new ProgressBar($output); $this->invokePrivate($instance, 'decryptUsersFiles', ['user1', $progressBar, '']); |