Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-07-31 11:02:29 +0300
committerGitHub <noreply@github.com>2016-07-31 11:02:29 +0300
commitd962904940afe172647d6ba38243c435a947dd93 (patch)
treeab753beaf0dd9536e6bff46692d2c525daa860b4 /build
parent396a4ad9a04520731c9106f5d84d9abca6c63d6f (diff)
[stable9] Adding quota plugin to new dav endpoint (#25615) (#25646)
* Adding quota plugin to new dav endpoint * Added integrated test failing in old endpoint * Added 0B quota test
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/WebDav.php12
-rw-r--r--build/integration/features/dav-v2.feature27
2 files changed, 38 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 092c79fe020..a63b752a015 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -22,6 +22,16 @@ trait WebDav {
$this->davPath = $davPath;
}
+ public function getFilesPath(){
+ $basePath = '';
+ 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();
@@ -425,7 +435,7 @@ trait WebDav {
*/
public function userCreatedAFolder($user, $destination){
try {
- $this->response = $this->makeDavRequest($user, "MKCOL", '/' . ltrim($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 9de78a7ed16..37a8e1d75ce 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"