summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-10-03 12:41:17 +0200
committerGitHub <noreply@github.com>2016-10-03 12:41:17 +0200
commita62f6fac516de2c06a2df6eadd2f086f545c9c4e (patch)
tree182d4072a36297e0a149c3d0b9a38b892a82d674
parent407232b77246c43460f7dc271f743905a8921e30 (diff)
parent554d0c58c370edf8b8237f394b37949d775edb30 (diff)
downloadnextcloud-server-a62f6fac516de2c06a2df6eadd2f086f545c9c4e.tar.gz
nextcloud-server-a62f6fac516de2c06a2df6eadd2f086f545c9c4e.zip
Merge pull request #1546 from nextcloud/integration-tests-qa-222
Integration tests qa 222
-rw-r--r--build/integration/features/bootstrap/BasicStructure.php7
-rw-r--r--build/integration/features/bootstrap/WebDav.php15
-rw-r--r--build/integration/features/webdav-related.feature22
3 files changed, 44 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php
index df46d0b1983..30d78ebd23a 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($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..be181f2bcb7 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -425,6 +425,21 @@ 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($filename, $bytes);
+ PHPUnit_Framework_Assert::assertEquals(1, file_exists("data/$filename"));
+ $this->userUploadsAFileTo($user, "data/$filename", $destination);
+ $this->removeFile("data/", $filename);
+ PHPUnit_Framework_Assert::assertEquals(1, file_exists("../../data/$user/files$destination"));
+ }
+
+ /**
* @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..01d437f519f 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -77,6 +77,28 @@ 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 "592"
+
+ Scenario: Retrieving folder quota when quota is set and a file was recieved
+ Given using dav path "remote.php/webdav"
+ And As an "admin"
+ And user "user0" exists
+ And user "user1" exists
+ And user "user1" has a quota of "1 KB"
+ And user "user0" adds a file of 93 bytes to "/user0.txt"
+ And file "user0.txt" of user "user0" is shared with user "user1"
+ When as "user1" gets properties of folder "/" with
+ |{DAV:}quota-available-bytes|
+ Then the single response should contain a property "{DAV:}quota-available-bytes" with value "685"
+
Scenario: download a public shared file with range
Given user "user0" exists
And As an "user0"