Browse Source

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>
pull/33433/head
Côme Chilliet 3 years ago
parent
commit
73702e6350
No known key found for this signature in database GPG Key ID: A3E2F658B28C760A
  1. 17
      apps/encryption/tests/Command/FixEncryptedVersionTest.php

17
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);
}

Loading…
Cancel
Save