mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fix Encryption tests on PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
bb9c099e42
commit
065531570d
1 changed files with 11 additions and 2 deletions
|
|
@ -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, '']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue