Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build/integration/features/bootstrap/BasicStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ public function modifyTextOfFile($user, $filename, $text) {
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
*/
Expand Down
15 changes: 15 additions & 0 deletions build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,21 @@ public function userUploadsAFileTo($user, $source, $destination)
}
}

/**
* @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
*/
Expand Down
22 changes: 22 additions & 0 deletions build/integration/features/webdav-related.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down