diff options
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 18 | ||||
-rw-r--r-- | build/integration/features/webdav-related.feature | 9 |
2 files changed, 27 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 8f0f30b377a..a682467f52d 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -73,6 +73,24 @@ trait WebDav{ } /** + * @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 "([^"]*)"$/ */ public function downloadedContentShouldBe($content){ diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 56c4d07f0eb..8be2c196308 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -24,6 +24,15 @@ Feature: sharing When User "user0" uploads file "data/textfile.txt" to "/asdf.txt" 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" + |