Added webdav test to check range downloads

This commit is contained in:
Sergio Bertolin 2015-11-30 14:07:02 +00:00
parent 52f6592991
commit 69ca3a70d6
2 changed files with 22 additions and 0 deletions

View File

@ -58,6 +58,22 @@ trait WebDav{
$this->response = $this->makeDavRequest($user, "MOVE", $fileSource, $headers);
}
/**
* @When /^Downloading file "([^"]*)" with range "([^"]*)"$/
*/
public function downloadFileWithRange($fileSource, $range){
$fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath;
$headers['Range'] = $range;
$this->response = $this->makeDavRequest($this->currentUser, "GET", $fileSource, $headers);
}
/**
* @Then /^Downloaded content should be "([^"]*)"$/
*/
public function downloadedContentShouldBe($content){
PHPUnit_Framework_Assert::assertEquals($content, (string)$this->response->getBody());
}
/*Returns the elements of a propfind, $folderDepth requires 1 to see elements without children*/
public function listFolder($user, $path, $folderDepth){
$fullUrl = substr($this->baseUrl, 0, -4);

View File

@ -9,6 +9,12 @@ Feature: sharing
When User "user0" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt"
Then the HTTP status code should be "201"
Scenario: download a file with range
Given using dav path "remote.php/webdav"
And As an "admin"
When Downloading file "/welcome.txt" with range "bytes=51-77"
Then Downloaded content should be "example file for developers"