Skip to content

Commit

Permalink
Adapt test to fixed command output.
Browse files Browse the repository at this point in the history
No user and non-existing user are now correctly treated as two separated
 cases

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc authored and backportbot-nextcloud[bot] committed Aug 22, 2022
1 parent 6090807 commit 0c1d0ea
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions apps/encryption/tests/Command/FixEncryptedVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,6 @@ public function testExecuteWithDirectoryPathOption() {
$this->assertStringNotContainsString('world.txt', $output);
}

/**
* Test commands with a directory path
*/
public function testExecuteWithNoUser() {
$this->util->expects($this->once())->method('isMasterKeyEnabled')
->willReturn(true);
Expand All @@ -347,6 +344,20 @@ public function testExecuteWithNoUser() {

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

Expand Down

0 comments on commit 0c1d0ea

Please sign in to comment.