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>
This commit is contained in:
Côme Chilliet 2022-08-04 10:06:36 +02:00 committed by backportbot-nextcloud[bot]
parent 6090807d0b
commit 0c1d0ea1fd

View file

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