diff options
Diffstat (limited to 'apps/encryption')
-rw-r--r-- | apps/encryption/lib/Command/FixEncryptedVersion.php | 5 | ||||
-rw-r--r-- | apps/encryption/tests/Crypto/EncryptAllTest.php | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php index d51f64c8ef9..073c1f1438a 100644 --- a/apps/encryption/lib/Command/FixEncryptedVersion.php +++ b/apps/encryption/lib/Command/FixEncryptedVersion.php @@ -116,10 +116,7 @@ class FixEncryptedVersion extends Command { $user = (string)$input->getArgument('user'); $pathToWalk = "/$user/files"; - /** - * trim() returns an empty string when the argument is an unset/null - */ - $pathOption = \trim($input->getOption('path'), '/'); + $pathOption = \trim(($input->getOption('path') ?? ''), '/'); if ($pathOption !== "") { $pathToWalk = "$pathToWalk/$pathOption"; } diff --git a/apps/encryption/tests/Crypto/EncryptAllTest.php b/apps/encryption/tests/Crypto/EncryptAllTest.php index 4a00b67f0b1..e5c10dd67e8 100644 --- a/apps/encryption/tests/Crypto/EncryptAllTest.php +++ b/apps/encryption/tests/Crypto/EncryptAllTest.php @@ -117,9 +117,12 @@ class EncryptAllTest 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')->willReturnArgument(0); $this->outputInterface->expects($this->any())->method('getFormatter') - ->willReturn($this->createMock(OutputFormatterInterface::class)); + ->willReturn($outputFormatter); $this->userManager->expects($this->any())->method('getBackends')->willReturn([$this->userInterface]); $this->userInterface->expects($this->any())->method('getUsers')->willReturn(['user1', 'user2']); |