Skip to content

Commit

Permalink
cli test for delete empty trash bin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Panta committed Jul 23, 2024
1 parent 4874aea commit b079d3c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/acceptance/features/bootstrap/CliContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ public function theAdministratorResetsThePasswordOfUserUsingTheCLI(string $statu
$this->featureContext->updateUserPassword($user, $password);
}

/**
* @When the administrator deletes empty folder inside trashbin using the CLI
*
* @return void
*/
public function theAdministratorDeletesEmptyTrashbinFolderUsingTheCli():void {
$path = $this->featureContext->getStorageUsersRoot();
$command = "trash purge-empty-dirs --p $path --dry-run=false";
$body = [
"command" => $command
];
$this->featureContext->setResponse((CliHelper::runCommand($body)));
}

/**
* @When the administrator checks the backup consistency using the CLI
*
Expand Down
14 changes: 14 additions & 0 deletions tests/acceptance/features/cliCommands/cleanupEmptyTrashBin.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@env-config
Feature: delete empty trash bin folder via CLI command


Scenario: delete empty trashbin
Given the user "Admin" has created a new user with the following attributes:
| userName | Alice |
| displayName | Alice Hansen |
| password | %alt1% |
And user "Alice" has created folder "/folderMain"
And user "Alice" has deleted folder "/folderMain"
And the administrator has stopped the server
When the administrator deletes empty folder inside trashbin using the CLI
Then the command should be successful

0 comments on commit b079d3c

Please sign in to comment.