summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/WebDav.php
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-06-30 14:41:23 +0200
committerGitHub <noreply@github.com>2016-06-30 14:41:23 +0200
commit8e002b61554308cb4d50570f715303a82136f0fa (patch)
treefa27987626d305fcc73170650d3ef6cfaedd7720 /build/integration/features/bootstrap/WebDav.php
parent2cdee70305d72ea018f5bccdcc8d62c159204ef9 (diff)
parent26e14529be942e3cc3c2bb2b388b155073daecb1 (diff)
downloadnextcloud-server-8e002b61554308cb4d50570f715303a82136f0fa.tar.gz
nextcloud-server-8e002b61554308cb4d50570f715303a82136f0fa.zip
Merge pull request #255 from nextcloud/dav-permission-check
add some additonal permission checks to the webdav backend
Diffstat (limited to 'build/integration/features/bootstrap/WebDav.php')
-rw-r--r--build/integration/features/bootstrap/WebDav.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 0abb8667739..23f80c2fa76 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -42,6 +42,7 @@ trait WebDav {
$request->setBody($body);
}
+
return $client->send($request);
}
@@ -71,6 +72,23 @@ trait WebDav {
}
/**
+ * @When /^User "([^"]*)" copies file "([^"]*)" to "([^"]*)"$/
+ * @param string $user
+ * @param string $fileSource
+ * @param string $fileDestination
+ */
+ public function userCopiesFileTo($user, $fileSource, $fileDestination) {
+ $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath;
+ $headers['Destination'] = $fullUrl . $fileDestination;
+ try {
+ $this->response = $this->makeDavRequest($user, 'COPY', $fileSource, $headers);
+ } catch (\GuzzleHttp\Exception\ClientException $e) {
+ // 4xx and 5xx responses cause an exception
+ $this->response = $e->getResponse();
+ }
+ }
+
+ /**
* @When /^Downloading file "([^"]*)" with range "([^"]*)"$/
* @param string $fileSource
* @param string $range