Added quota calculation test when a file is recieved

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Sergio Bertolin 2016-09-26 12:10:24 +00:00 committed by Roeland Jago Douma
parent 7413e2a88c
commit e011065a08
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
3 changed files with 15 additions and 2 deletions

View File

@ -313,7 +313,7 @@ trait BasicStructure {
file_put_contents("../../data/$user/files" . "$filename", "$text");
}
public function createFileSpecificSize($user, $name, $size){
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

View File

@ -432,10 +432,11 @@ trait WebDav {
*/
public function userAddsAFileTo($user, $bytes, $destination){
$filename = "filespecificSize.txt";
$this->createFileSpecificSize($user, $filename, $bytes);
$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"));
}
/**

View File

@ -87,6 +87,18 @@ Feature: webdav-related
|{DAV:}quota-available-bytes|
Then the single response should contain a property "{DAV:}quota-available-bytes" with value "600"
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 "693"
Scenario: download a public shared file with range
Given user "user0" exists
And As an "user0"