diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2017-03-15 14:31:48 +0000 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-20 02:19:04 -0600 |
commit | 493b4c2f5c7feae9b736cb128883836d036cf887 (patch) | |
tree | 9742b5c1a814224ff28cbf357ded08b83d55eccf /build/integration/features/bootstrap/WebDav.php | |
parent | daa7e1109598417e133d756083b8fc8c75a2850f (diff) | |
download | nextcloud-server-493b4c2f5c7feae9b736cb128883836d036cf887.tar.gz nextcloud-server-493b4c2f5c7feae9b736cb128883836d036cf887.zip |
Added logic and tests to remove everything inside a folder
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 680d8f96e7c..0a75ff96732 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -729,4 +729,23 @@ trait WebDav { } } + /** + * @When /^User "([^"]*)" deletes everything from folder "([^"]*)"$/ + * @param string $user + * @param string $folder + */ + public function userDeletesEverythingInFolder($user, $folder) { + $elementList = $this->listFolder($user, $folder, 1); + $elementListKeys = array_keys($elementList); + array_shift($elementListKeys); + $davPrefix = "/" . $this->getDavFilesPath($user); + foreach($elementListKeys as $element) { + if (substr($element, 0, strlen($davPrefix)) == $davPrefix) { + $element = substr($element, strlen($davPrefix)); + } + $this->userDeletesFile($user, "element", $element); + } + } + + } |