diff options
author | Björn Schießle <bjoern@schiessle.org> | 2016-07-29 11:44:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 11:44:34 +0200 |
commit | 6cf7bf111ec9d7fac268b25653f6ce44f74da2a0 (patch) | |
tree | d13bf29e9774cec351d3939e4c963ed368180200 /build/integration | |
parent | 41d044cf89d8df6ed2233bd24da3469cf145760c (diff) | |
parent | 6f34c37cfbaab73d13ba552d500311431cfd6303 (diff) | |
download | nextcloud-server-6cf7bf111ec9d7fac268b25653f6ce44f74da2a0.tar.gz nextcloud-server-6cf7bf111ec9d7fac268b25653f6ce44f74da2a0.zip |
Merge pull request #648 from nextcloud/add-quotaplugin-v2-master
[upstream] Adding quota plugin to new dav endpoint
Diffstat (limited to 'build/integration')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 16 | ||||
-rw-r--r-- | build/integration/features/dav-v2.feature | 27 |
2 files changed, 41 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 9b0050d82dd..71f938c7ec4 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -50,6 +50,18 @@ trait WebDav { $this->davPath = $davPath; } + /** + * @return string + */ + public function getFilesPath() { + if ($this->davPath === 'remote.php/dav') { + $basePath = '/files/' . $this->currentUser . '/'; + } else { + $basePath = '/'; + } + return $basePath; + } + public function makeDavRequest($user, $method, $path, $headers, $body = null){ $fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path"; $client = new GClient(); @@ -413,9 +425,9 @@ trait WebDav { * @param string $user * @param string $destination */ - public function userCreatedAFolder($user, $destination){ + public function userCreatedAFolder($user, $destination) { try { - $this->response = $this->makeDavRequest($user, "MKCOL", $destination, []); + $this->response = $this->makeDavRequest($user, "MKCOL", $this->getFilesPath() . ltrim($destination, $this->getFilesPath()), []); } catch (\GuzzleHttp\Exception\ServerException $e) { // 4xx and 5xx responses cause an exception $this->response = $e->getResponse(); diff --git a/build/integration/features/dav-v2.feature b/build/integration/features/dav-v2.feature index d2ac047b68c..85405cbf93e 100644 --- a/build/integration/features/dav-v2.feature +++ b/build/integration/features/dav-v2.feature @@ -53,3 +53,30 @@ Feature: dav-v2 Given Logging in using web as "admin" When Sending a "PROPFIND" to "/remote.php/dav/files/admin/welcome.txt" with requesttoken Then the HTTP status code should be "207" + + Scenario: Uploading a file having 0B as quota + Given using dav path "remote.php/dav" + And As an "admin" + And user "user0" exists + And user "user0" has a quota of "0 B" + And As an "user0" + When User "user0" uploads file "data/textfile.txt" to "/files/user0/asdf.txt" + Then the HTTP status code should be "507" + + Scenario: Uploading a file as recipient using webdav new endpoint having quota + Given using dav path "remote.php/dav" + And As an "admin" + And user "user0" exists + And user "user1" exists + And user "user0" has a quota of "10 MB" + And user "user1" has a quota of "10 MB" + And As an "user1" + And user "user1" created a folder "/testquota" + And as "user1" creating a share with + | path | testquota | + | shareType | 0 | + | permissions | 31 | + | shareWith | user0 | + And As an "user0" + When User "user0" uploads file "data/textfile.txt" to "/files/user0/testquota/asdf.txt" + Then the HTTP status code should be "201" |