Added test case about downloading by range a public shared file
This commit is contained in:
parent
7fefd4f4d9
commit
b17553d921
|
@ -72,6 +72,24 @@ trait WebDav{
|
||||||
$this->response = $this->makeDavRequest($this->currentUser, "GET", $fileSource, $headers);
|
$this->response = $this->makeDavRequest($this->currentUser, "GET", $fileSource, $headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When /^Downloading last public shared file with range "([^"]*)"$/
|
||||||
|
*/
|
||||||
|
public function downloadPublicFileWithRange($range){
|
||||||
|
$token = $this->lastShareData->data->token;
|
||||||
|
$fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav";
|
||||||
|
$headers['Range'] = $range;
|
||||||
|
|
||||||
|
$client = new GClient();
|
||||||
|
$options = [];
|
||||||
|
$options['auth'] = [$token, ""];
|
||||||
|
|
||||||
|
$request = $client->createRequest("GET", $fullUrl, $options);
|
||||||
|
$request->addHeader('Range', $range);
|
||||||
|
|
||||||
|
$this->response = $client->send($request);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then /^Downloaded content should be "([^"]*)"$/
|
* @Then /^Downloaded content should be "([^"]*)"$/
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,6 +24,15 @@ Feature: sharing
|
||||||
When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
|
When User "user0" uploads file "data/textfile.txt" to "/asdf.txt"
|
||||||
Then the HTTP status code should be "507"
|
Then the HTTP status code should be "507"
|
||||||
|
|
||||||
|
Scenario: download a public shared file with range
|
||||||
|
Given user "user0" exists
|
||||||
|
And As an "user0"
|
||||||
|
When creating a share with
|
||||||
|
| path | welcome.txt |
|
||||||
|
| shareType | 3 |
|
||||||
|
And Downloading last public shared file with range "bytes=51-77"
|
||||||
|
Then Downloaded content should be "example file for developers"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue