diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-16 16:35:01 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-28 13:18:29 +0200 |
commit | 0f6760c810e370023728d93a31f69c79dc5c3e3d (patch) | |
tree | ec8ac8201ef131b1f1727b33060c731b915414b0 /build | |
parent | 2f66bd5b754f072a3cfeda759d71a479e4538350 (diff) | |
download | nextcloud-server-0f6760c810e370023728d93a31f69c79dc5c3e3d.tar.gz nextcloud-server-0f6760c810e370023728d93a31f69c79dc5c3e3d.zip |
feat(files): Make the files download action use WebDAV zip download
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/Download.php | 3 | ||||
-rw-r--r-- | build/integration/files_features/download.feature | 56 |
2 files changed, 30 insertions, 29 deletions
diff --git a/build/integration/features/bootstrap/Download.php b/build/integration/features/bootstrap/Download.php index 1434e182e7d..bef89d2ddb6 100644 --- a/build/integration/features/bootstrap/Download.php +++ b/build/integration/features/bootstrap/Download.php @@ -21,8 +21,9 @@ trait Download { * @When user :user downloads zip file for entries :entries in folder :folder */ public function userDownloadsZipFileForEntriesInFolder($user, $entries, $folder) { + $folder = trim($folder, '/'); $this->asAn($user); - $this->sendingToDirectUrl('GET', '/index.php/apps/files/ajax/download.php?dir=' . $folder . '&files=[' . $entries . ']'); + $this->sendingToDirectUrl('GET', "/remote.php/dav/files/$user/$folder?accept=zip&files=[" . $entries . ']'); $this->theHTTPStatusCodeShouldBe('200'); } diff --git a/build/integration/files_features/download.feature b/build/integration/files_features/download.feature index 176963c2610..f9d4e7e95b9 100644 --- a/build/integration/files_features/download.feature +++ b/build/integration/files_features/download.feature @@ -2,60 +2,60 @@ # SPDX-License-Identifier: AGPL-3.0-or-later Feature: download - Scenario: downloading 2 small files returns a zip32 + Scenario: downloading 2 small files Given using new dav path And user "user0" exists And User "user0" copies file "/welcome.txt" to "/welcome2.txt" When user "user0" downloads zip file for entries '"welcome.txt","welcome2.txt"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/welcome.txt" from "user0" data And the downloaded zip file contains a file named "welcome2.txt" with the contents of "/welcome2.txt" from "user0" data - Scenario: downloading a small file and a directory returns a zip32 + Scenario: downloading a small file and a directory Given using new dav path And user "user0" exists And user "user0" created a folder "/emptySubFolder" When user "user0" downloads zip file for entries '"welcome.txt","emptySubFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "emptySubFolder/" - Scenario: downloading a small file and 2 nested directories returns a zip32 + Scenario: downloading a small file and 2 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/subFolder" And user "user0" created a folder "/subFolder/emptySubSubFolder" When user "user0" downloads zip file for entries '"welcome.txt","subFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "subFolder/" And the downloaded zip file contains a folder named "subFolder/emptySubSubFolder/" - Scenario: downloading dir with 2 small files returns a zip32 + Scenario: downloading dir with 2 small files Given using new dav path And user "user0" exists And user "user0" created a folder "/sparseFolder" And User "user0" copies file "/welcome.txt" to "/sparseFolder/welcome.txt" And User "user0" copies file "/welcome.txt" to "/sparseFolder/welcome2.txt" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a file named "sparseFolder/welcome2.txt" with the contents of "/sparseFolder/welcome2.txt" from "user0" data - Scenario: downloading dir with a small file and a directory returns a zip32 + Scenario: downloading dir with a small file and a directory Given using new dav path And user "user0" exists And user "user0" created a folder "/sparseFolder" And User "user0" copies file "/welcome.txt" to "/sparseFolder/welcome.txt" And user "user0" created a folder "/sparseFolder/emptySubFolder" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "sparseFolder/emptySubFolder/" - Scenario: downloading dir with a small file and 2 nested directories returns a zip32 + Scenario: downloading dir with a small file and 2 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/sparseFolder" @@ -63,35 +63,35 @@ Feature: download And user "user0" created a folder "/sparseFolder/subFolder" And user "user0" created a folder "/sparseFolder/subFolder/emptySubSubFolder" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "sparseFolder/subFolder/" And the downloaded zip file contains a folder named "sparseFolder/subFolder/emptySubSubFolder/" - Scenario: downloading (from folder) 2 small files returns a zip32 + Scenario: downloading (from folder) 2 small files Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" And User "user0" copies file "/welcome.txt" to "/baseFolder/welcome.txt" And User "user0" copies file "/welcome.txt" to "/baseFolder/welcome2.txt" When user "user0" downloads zip file for entries '"welcome.txt","welcome2.txt"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/baseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a file named "welcome2.txt" with the contents of "/baseFolder/welcome2.txt" from "user0" data - Scenario: downloading (from folder) a small file and a directory returns a zip32 + Scenario: downloading (from folder) a small file and a directory Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" And User "user0" copies file "/welcome.txt" to "/baseFolder/welcome.txt" And user "user0" created a folder "/baseFolder/emptySubFolder" When user "user0" downloads zip file for entries '"welcome.txt","emptySubFolder"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/baseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "emptySubFolder/" - Scenario: downloading (from folder) a small file and 2 nested directories returns a zip32 + Scenario: downloading (from folder) a small file and 2 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" @@ -99,12 +99,12 @@ Feature: download And user "user0" created a folder "/baseFolder/subFolder" And user "user0" created a folder "/baseFolder/subFolder/emptySubSubFolder" When user "user0" downloads zip file for entries '"welcome.txt","subFolder"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/baseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "subFolder/" And the downloaded zip file contains a folder named "subFolder/emptySubSubFolder/" - Scenario: downloading (from folder) dir with 2 small files returns a zip32 + Scenario: downloading (from folder) dir with 2 small files Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" @@ -112,12 +112,12 @@ Feature: download And User "user0" copies file "/welcome.txt" to "/baseFolder/sparseFolder/welcome.txt" And User "user0" copies file "/welcome.txt" to "/baseFolder/sparseFolder/welcome2.txt" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/baseFolder/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a file named "sparseFolder/welcome2.txt" with the contents of "/baseFolder/sparseFolder/welcome2.txt" from "user0" data - Scenario: downloading (from folder) dir with a small file and a directory returns a zip32 + Scenario: downloading (from folder) dir with a small file and a directory Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" @@ -125,12 +125,12 @@ Feature: download And User "user0" copies file "/welcome.txt" to "/baseFolder/sparseFolder/welcome.txt" And user "user0" created a folder "/baseFolder/sparseFolder/emptySubFolder" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/baseFolder/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "sparseFolder/emptySubFolder/" - Scenario: downloading (from folder) dir with a small file and 2 nested directories returns a zip32 + Scenario: downloading (from folder) dir with a small file and 2 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/baseFolder" @@ -139,14 +139,14 @@ Feature: download And user "user0" created a folder "/baseFolder/sparseFolder/subFolder" And user "user0" created a folder "/baseFolder/sparseFolder/subFolder/emptySubSubFolder" When user "user0" downloads zip file for entries '"sparseFolder"' in folder "/baseFolder/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "sparseFolder/" And the downloaded zip file contains a file named "sparseFolder/welcome.txt" with the contents of "/baseFolder/sparseFolder/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "sparseFolder/subFolder/" And the downloaded zip file contains a folder named "sparseFolder/subFolder/emptySubSubFolder/" @large - Scenario: downloading small file and dir with 65524 small files and 9 nested directories returns a zip32 + Scenario: downloading small file and dir with 65524 small files and 9 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/crowdedFolder" @@ -174,7 +174,7 @@ Feature: download And user "user0" created a folder "/crowdedFolder/subFolder7/subSubFolder" And user "user0" created a folder "/crowdedFolder/subFolder7/subSubFolder/emptySubSubSubFolder" When user "user0" downloads zip file for entries '"welcome.txt","crowdedFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a file named "welcome.txt" with the contents of "/welcome.txt" from "user0" data And the downloaded zip file contains a folder named "crowdedFolder/" And the downloaded zip file contains a folder named "crowdedFolder/subFolder1/" @@ -183,7 +183,7 @@ Feature: download And the downloaded zip file contains a folder named "crowdedFolder/subFolder7/subSubFolder/emptySubSubSubFolder/" @large - Scenario: downloading dir with 65525 small files and 9 nested directories returns a zip32 + Scenario: downloading dir with 65525 small files and 9 nested directories Given using new dav path And user "user0" exists And user "user0" created a folder "/crowdedFolder" @@ -211,7 +211,7 @@ Feature: download And user "user0" created a folder "/crowdedFolder/subFolder7/subSubFolder" And user "user0" created a folder "/crowdedFolder/subFolder7/subSubFolder/emptySubSubSubFolder" When user "user0" downloads zip file for entries '"crowdedFolder"' in folder "/" - Then the downloaded zip file is a zip32 file + Then the downloaded file is a zip file And the downloaded zip file contains a folder named "crowdedFolder/" And the downloaded zip file contains a folder named "crowdedFolder/subFolder1/" And the downloaded zip file contains a file named "crowdedFolder/subFolder1/test.txt-0" with the contents of "/crowdedFolder/subFolder1/test.txt-0" from "user0" data |