add test to remove versions of a file using file id
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ use TestHelpers\OcisConfigHelper;
|
||||
*/
|
||||
class CliContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
private SpacesContext $spacesContext;
|
||||
|
||||
/**
|
||||
* @BeforeScenario
|
||||
@@ -45,6 +46,7 @@ class CliContext implements Context {
|
||||
$environment = $scope->getEnvironment();
|
||||
// Get all the contexts you need in this context
|
||||
$this->featureContext = $environment->getContext('FeatureContext');
|
||||
$this->spacesContext = $environment->getContext('SpacesContext');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,6 +120,25 @@ class CliContext implements Context {
|
||||
$this->featureContext->setResponse(CliHelper::runCommand($body));
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator removes the versions of file :file of user :user from space :space using the CLI
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $user
|
||||
* @param string $space
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorRemovesTheVersionsOfFileUsingFileId($file, $user, $space) {
|
||||
$path = $this->featureContext->getStorageUsersRoot();
|
||||
$fileId = $this->spacesContext->getFileId($user, $space, $file);
|
||||
$command = "revisions purge -p $path -r $fileId --dry-run=false";
|
||||
$body = [
|
||||
"command" => $command
|
||||
];
|
||||
$this->featureContext->setResponse(CliHelper::runCommand($body));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the command should be successful
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user