summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-08-04 10:06:36 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-08-04 10:06:36 +0200
commit73702e6350355b6961f92925fc411840b837c340 (patch)
tree6bb995defc92a55430c59eec23177f7f50cc2387 /apps
parentb20278f70834c8f9eee21ab967dd24e69591cd3c (diff)
downloadnextcloud-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.php17
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);
}