aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-21 13:03:48 +0100
committerGitHub <noreply@github.com>2016-12-21 13:03:48 +0100
commit591b60d11cd5e2aa451bb9e08e3c1ed28300b704 (patch)
tree6db4f831c9eff94127a1f77370575e95fea2e38c /build/integration
parent091bf07385a6e850383ee8364e282a5bbac6adc2 (diff)
parent29a1ebc3627795a38d3149307d57b89488bcff0f (diff)
downloadnextcloud-server-591b60d11cd5e2aa451bb9e08e3c1ed28300b704.tar.gz
nextcloud-server-591b60d11cd5e2aa451bb9e08e3c1ed28300b704.zip
Merge pull request #2758 from nextcloud/only-one-dav-backend
Register only one dav backend
Diffstat (limited to 'build/integration')
-rw-r--r--build/integration/features/bootstrap/WebDav.php24
-rw-r--r--build/integration/features/webdav-related.feature16
2 files changed, 40 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index c44a6175579..6438a871fb1 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -657,4 +657,28 @@ trait WebDav {
$this->asGetsPropertiesOfFolderWith($user, 'entry', $path, $propertiesTable);
PHPUnit_Framework_Assert::assertNotEquals($this->response['{DAV:}getetag'], $this->storedETAG[$user][$path]);
}
+
+ /**
+ * @When Connecting to dav endpoint
+ */
+ public function connectingToDavEndpoint() {
+ try {
+ $this->response = $this->makeDavRequest(null, 'PROPFIND', '', []);
+ } catch (\GuzzleHttp\Exception\ClientException $e) {
+ $this->response = $e->getResponse();
+ }
+ }
+
+ /**
+ * @Then there are no duplicate headers
+ */
+ public function thereAreNoDuplicateHeaders() {
+ $headers = $this->response->getHeaders();
+ foreach ($headers as $headerName => $headerValues) {
+ // if a header has multiple values, they must be different
+ if (count($headerValues) > 1 && count(array_unique($headerValues)) < count($headerValues)) {
+ throw new \Exception('Duplicate header found: ' . $headerName);
+ }
+ }
+ }
}
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index b75fdd35618..c3aa6145527 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -2,6 +2,22 @@ Feature: webdav-related
Background:
Given using api version "1"
+ Scenario: Unauthenticated call old dav path
+ Given using old dav path
+ When connecting to dav endpoint
+ Then the HTTP status code should be "401"
+ And there are no duplicate headers
+ And The following headers should be set
+ |WWW-Authenticate|Basic realm="Nextcloud"|
+
+ Scenario: Unauthenticated call new dav path
+ Given using new dav path
+ When connecting to dav endpoint
+ Then the HTTP status code should be "401"
+ And there are no duplicate headers
+ And The following headers should be set
+ |WWW-Authenticate|Basic realm="Nextcloud"|
+
Scenario: Moving a file
Given using old dav path
And As an "admin"