diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-12-21 13:03:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 13:03:48 +0100 |
commit | 591b60d11cd5e2aa451bb9e08e3c1ed28300b704 (patch) | |
tree | 6db4f831c9eff94127a1f77370575e95fea2e38c /build/integration/features/bootstrap/WebDav.php | |
parent | 091bf07385a6e850383ee8364e282a5bbac6adc2 (diff) | |
parent | 29a1ebc3627795a38d3149307d57b89488bcff0f (diff) | |
download | nextcloud-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/features/bootstrap/WebDav.php')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 24 |
1 files changed, 24 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); + } + } + } } |