]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added test case about downloading by range a public shared file
authorSergio Bertolin <sbertolin@solidgear.es>
Thu, 3 Dec 2015 09:46:00 +0000 (09:46 +0000)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 3 Dec 2015 09:58:31 +0000 (10:58 +0100)
build/integration/features/bootstrap/WebDav.php
build/integration/features/webdav-related.feature

index 8f0f30b377aec1ad52a1dda58baf160ebd1fcf01..a682467f52d208ae080d9c4f3d6af5a9b2f19c76 100644 (file)
@@ -72,6 +72,24 @@ trait WebDav{
                $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 "([^"]*)"$/
         */
index 56c4d07f0eb553b9ab4882d0341aeb3d46f7ef35..8be2c1963085b58fe8c0e23887aa9927eb84ea54 100644 (file)
@@ -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"
+