summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/WebDav.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-30 12:15:58 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-30 12:21:01 +0200
commitb32b296ed770044b347e9216f3f4ad68c55b14f3 (patch)
tree1fb9b7c05f878729e14068db05691568b37bf9bb /build/integration/features/bootstrap/WebDav.php
parent3571207bd956de5dc8aece2ba879f31f3696fef6 (diff)
downloadnextcloud-server-b32b296ed770044b347e9216f3f4ad68c55b14f3.tar.gz
nextcloud-server-b32b296ed770044b347e9216f3f4ad68c55b14f3.zip
Add integration tests
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