diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-04 10:06:36 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-08-04 10:06:36 +0200 |
commit | 73702e6350355b6961f92925fc411840b837c340 (patch) | |
tree | 6bb995defc92a55430c59eec23177f7f50cc2387 /apps | |
parent | b20278f70834c8f9eee21ab967dd24e69591cd3c (diff) | |
download | nextcloud-server-73702e6350355b6961f92925fc411840b837c340.tar.gz nextcloud-server-73702e6350355b6961f92925fc411840b837c340.zip |
Adapt test to fixed command output.
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')
-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); } |