diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2015-11-30 14:07:02 +0000 |
---|---|---|
committer | Sergio Bertolin <sbertolin@solidgear.es> | 2015-11-30 14:07:02 +0000 |
commit | 69ca3a70d674c7c7599a4523c41fd87aa2adb3df (patch) | |
tree | 12896e614bacd3f217521766873c8f82b941bda2 /build | |
parent | 52f6592991956f79724b98036803fde6452e8c66 (diff) | |
download | nextcloud-server-69ca3a70d674c7c7599a4523c41fd87aa2adb3df.tar.gz nextcloud-server-69ca3a70d674c7c7599a4523c41fd87aa2adb3df.zip |
Added webdav test to check range downloads
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 16 | ||||
-rw-r--r-- | build/integration/features/webdav-related.feature | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 2bbe44e9c59..567f189c61e 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -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); diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index 961b6b03431..16955e27063 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -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" + |