diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-04 11:06:36 +0300 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2022-08-22 12:16:16 +0300 |
commit | 0c1d0ea1fd4d90de3f9fbc6f36e92c9526fed307 (patch) | |
tree | 9359f56c5599f93bd558fbd81798f1008b79dffa /apps/encryption | |
parent | 6090807d0b44bddd30473f875dcb9002b79dd169 (diff) |
Adapt test to fixed command output.backport/33433/stable24
No user and non-existing user are now correctly treated as two separated
cases
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/encryption')
-rw-r--r-- | apps/encryption/tests/Command/FixEncryptedVersionTest.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index 14143223264..ee9ad1ac89f 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -333,9 +333,6 @@ The file \"/$this->userId/files/sub/hello.txt\" is: OK", $output); $this->assertStringNotContainsString('world.txt', $output); } - /** - * Test commands with a directory path - */ public function testExecuteWithNoUser() { $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn(true); @@ -347,6 +344,20 @@ The file \"/$this->userId/files/sub/hello.txt\" is: OK", $output); $output = $this->commandTester->getDisplay(); + $this->assertStringContainsString('No user id provided', $output); + } + + public function testExecuteWithBadUser() { + $this->util->expects($this->once())->method('isMasterKeyEnabled') + ->willReturn(true); + + $this->commandTester->execute([ + 'user' => 'nonexisting', + '--path' => "/" + ]); + + $output = $this->commandTester->getDisplay(); + $this->assertStringContainsString('does not exist', $output); } |