add test to remove versions of files from space using space id

Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
prashant-gurung899
2024-07-19 14:07:29 +05:45
parent d48cae6fd3
commit 89ca45bc80
2 changed files with 52 additions and 4 deletions
@@ -168,6 +168,24 @@ class CliContext implements Context {
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
/**
* @When the administrator removes the file versions of space :space using the CLI
*
* @param string $space
*
* @return void
*/
public function theAdministratorRemovesTheVersionsOfFilesInSpaceUsingSpaceId(string $space):void {
$path = $this->featureContext->getStorageUsersRoot();
$adminUsername = $this->featureContext->getAdminUsername();
$spaceId = $this->spacesContext->getSpaceIdByName($adminUsername, $space);
$command = "revisions purge -p $path -r $spaceId --dry-run=false";
$body = [
"command" => $command
];
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
/**
* @Then the command should be successful
*