[tests-only] test: add test to download multiple files from public link#12125
Open
kavitagautam wants to merge 1 commit intomasterfrom
Open
[tests-only] test: add test to download multiple files from public link#12125kavitagautam wants to merge 1 commit intomasterfrom
kavitagautam wants to merge 1 commit intomasterfrom
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
b4b02c8 to
aef2426
Compare
6c19863 to
b62c1b9
Compare
605e089 to
495d9b8
Compare
38ac902 to
467f3e8
Compare
467f3e8 to
982296c
Compare
982296c to
9308c61
Compare
saw-jan
reviewed
Apr 29, 2026
saw-jan
reviewed
Apr 29, 2026
69ba83b to
e712c9f
Compare
saw-jan
reviewed
May 4, 2026
e712c9f to
bc22a25
Compare
anon-pradip
reviewed
May 4, 2026
Signed-off-by: Kavita Gautam <kavita@jankaritech.com> test: public link multifile download Signed-off-by: Kavita Gautam <kavita@jankaritech.com> Apply suggestions from code review Co-authored-by: Sawjan Gurung <saw.jan.grg3e@gmail.com>
bc22a25 to
9bad443
Compare
saw-jan
reviewed
May 5, 2026
Comment on lines
+57
to
+60
| | resource | project-folder | | ||
| | space | new-space | | ||
| | permissionsRole | <permissionsRole> | | ||
| | password | %public% | |
Member
There was a problem hiding this comment.
Suggested change
| | resource | project-folder | | |
| | space | new-space | | |
| | permissionsRole | <permissionsRole> | | |
| | password | %public% | | |
| | resource | project-folder | | |
| | space | new-space | | |
| | permissionsRole | <permissionsRole> | | |
| | password | %public% | |
saw-jan
reviewed
May 5, 2026
Comment on lines
+279
to
+317
| $body = '<?xml version="1.0"?> | ||
| <d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> | ||
| <d:prop> | ||
| <d:resourcetype/> | ||
| <oc:public-link-item-type/> | ||
| <oc:public-link-permission/> | ||
| <oc:public-link-expiration/> | ||
| <oc:fileid/> | ||
| <oc:downloadURL/> | ||
| <oc:signature-auth/> | ||
| <oc:public-link-share-datetime/> | ||
| <oc:public-link-share-owner/> | ||
| </d:prop> | ||
| </d:propfind>'; | ||
|
|
||
| $token = $this->featureContext->isUsingSharingNG() | ||
| ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() | ||
| : $this->featureContext->getLastCreatedPublicShareToken(); | ||
|
|
||
| $password = $this->featureContext->getActualPassword($password); | ||
|
|
||
| $url = $this->featureContext->getBaseUrl() . "/dav/public-files/$token"; | ||
|
|
||
| $headers = [ | ||
| "Depth" => "1", | ||
| "OCS-APIRequest" => "true", | ||
| "public-token" => $token, | ||
| "Content-Type" => "application/xml; charset=utf-8", | ||
| "Authorization" => "Basic " . base64_encode("public:$password"), | ||
| ]; | ||
|
|
||
| $response = HttpRequestHelper::sendRequest( | ||
| $url, | ||
| "PROPFIND", | ||
| null, | ||
| null, | ||
| $headers, | ||
| $body, | ||
| ); |
Member
There was a problem hiding this comment.
check if this works
Suggested change
| $body = '<?xml version="1.0"?> | |
| <d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> | |
| <d:prop> | |
| <d:resourcetype/> | |
| <oc:public-link-item-type/> | |
| <oc:public-link-permission/> | |
| <oc:public-link-expiration/> | |
| <oc:fileid/> | |
| <oc:downloadURL/> | |
| <oc:signature-auth/> | |
| <oc:public-link-share-datetime/> | |
| <oc:public-link-share-owner/> | |
| </d:prop> | |
| </d:propfind>'; | |
| $token = $this->featureContext->isUsingSharingNG() | |
| ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() | |
| : $this->featureContext->getLastCreatedPublicShareToken(); | |
| $password = $this->featureContext->getActualPassword($password); | |
| $url = $this->featureContext->getBaseUrl() . "/dav/public-files/$token"; | |
| $headers = [ | |
| "Depth" => "1", | |
| "OCS-APIRequest" => "true", | |
| "public-token" => $token, | |
| "Content-Type" => "application/xml; charset=utf-8", | |
| "Authorization" => "Basic " . base64_encode("public:$password"), | |
| ]; | |
| $response = HttpRequestHelper::sendRequest( | |
| $url, | |
| "PROPFIND", | |
| null, | |
| null, | |
| $headers, | |
| $body, | |
| ); | |
| $token = $this->featureContext->isUsingSharingNG() | |
| ? $this->featureContext->shareNgGetLastCreatedLinkShareToken() | |
| : $this->featureContext->getLastCreatedPublicShareToken(); | |
| $password = $this->featureContext->getActualPassword($password); | |
| $response = WebDavHelper::propfind( | |
| $this->featureContext->getBaseUrl(), | |
| "public", | |
| "$password", | |
| "$token", | |
| ['oc:fileid', 'oc:downloadURL', 'oc:signature-auth'], | |
| null, | |
| null, | |
| "public-files", | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This test verifies that a public user can successfully download a ZIP archive of files from a shared folder inside a space using a public link.
Related Issue
#12037
How Has This Been Tested?
Types of changes
Checklist: