summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2016-09-26 10:44:14 +0000
committerRoeland Jago Douma <roeland@famdouma.nl>2016-10-02 21:16:49 +0200
commit7413e2a88ca7479f06acc3ab25f9958150dcae97 (patch)
treea5a04f05bc4bf0ae2fc5dd24223f18d7f42281c5 /build
parent6297d201df57f91085e17cf974a4e1ad08475a0c (diff)
downloadnextcloud-server-7413e2a88ca7479f06acc3ab25f9958150dcae97.tar.gz
nextcloud-server-7413e2a88ca7479f06acc3ab25f9958150dcae97.zip
Added test checking quota after usage
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/BasicStructure.php7
-rw-r--r--build/integration/features/bootstrap/WebDav.php14
-rw-r--r--build/integration/features/webdav-related.feature10
3 files changed, 31 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php
index df46d0b1983..c2a826521ad 100644
--- a/build/integration/features/bootstrap/BasicStructure.php
+++ b/build/integration/features/bootstrap/BasicStructure.php
@@ -313,6 +313,13 @@ trait BasicStructure {
file_put_contents("../../data/$user/files" . "$filename", "$text");
}
+ public function createFileSpecificSize($user, $name, $size){
+ $file = fopen("data/" . "$name", 'w');
+ fseek($file, $size - 1 ,SEEK_CUR);
+ fwrite($file,'a'); // write a dummy char at SIZE position
+ fclose($file);
+ }
+
/**
* @BeforeSuite
*/
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index 02f3e82a4c3..f4904e5ae7a 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -425,6 +425,20 @@ trait WebDav {
}
/**
+ * @When User :user adds a file of :bytes bytes to :destination
+ * @param string $user
+ * @param string $bytes
+ * @param string $destination
+ */
+ public function userAddsAFileTo($user, $bytes, $destination){
+ $filename = "filespecificSize.txt";
+ $this->createFileSpecificSize($user, $filename, $bytes);
+ PHPUnit_Framework_Assert::assertEquals(1, file_exists("data/$filename"));
+ $this->userUploadsAFileTo($user, "data/$filename", $destination);
+ $this->removeFile("data/", $filename);
+ }
+
+ /**
* @When User :user uploads file with content :content to :destination
*/
public function userUploadsAFileWithContentTo($user, $content, $destination)
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index a59d65a2674..86ceafb1fc5 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -77,6 +77,16 @@ Feature: webdav-related
When User "user0" uploads file "data/textfile.txt" to "/testquota/asdf.txt"
Then the HTTP status code should be "201"
+ Scenario: Retrieving folder quota when quota is set and a file was uploaded
+ Given using dav path "remote.php/webdav"
+ And As an "admin"
+ And user "user0" exists
+ And user "user0" has a quota of "1 KB"
+ And user "user0" adds a file of 93 bytes to "/prueba.txt"
+ When as "user0" gets properties of folder "/" with
+ |{DAV:}quota-available-bytes|
+ Then the single response should contain a property "{DAV:}quota-available-bytes" with value "600"
+
Scenario: download a public shared file with range
Given user "user0" exists
And As an "user0"