test: add test for delayed share validate

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-02-17 00:04:17 +01:00
parent 6f253302ae
commit 9422634185
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB
2 changed files with 46 additions and 0 deletions

View file

@ -34,6 +34,8 @@ class SharingContext implements Context, SnippetAcceptingContext {
$this->deleteServerConfig('core', 'shareapi_allow_federation_on_public_shares');
$this->deleteServerConfig('files_sharing', 'outgoing_server2server_share_enabled');
$this->deleteServerConfig('core', 'shareapi_allow_view_without_download');
$this->deleteServerConfig('files_sharing', 'update_single_cutoff');
$this->deleteServerConfig('files_sharing', 'update_all_cutoff');
$this->runOcc(['config:system:delete', 'share_folder']);
}

View file

@ -77,6 +77,50 @@ Scenario: getting all shares of a file with reshares with link share with less p
| share_with | user2 |
| share_with_displayname | user2 |
Scenario: getting all shares of a file with a received share after revoking the resharing rights with delayed share check
Given user "user0" exists
And parameter "update_single_cutoff" of app "files_sharing" is set to "0"
And parameter "update_all_cutoff" of app "files_sharing" is set to "0"
And user "user1" exists
And user "user2" exists
And file "textfile0.txt" of user "user1" is shared with user "user0"
And user "user0" accepts last share
And Updating last share with
| permissions | 1 |
And file "textfile0.txt" of user "user1" is shared with user "user2"
When As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
Then the list of returned shares has 1 shares
And share 0 is returned with
| share_type | 0 |
| uid_owner | user1 |
| displayname_owner | user1 |
| path | /textfile0 (2).txt |
| item_type | file |
| mimetype | text/plain |
| storage_id | shared::/textfile0 (2).txt |
| file_target | /textfile0.txt |
| share_with | user2 |
| share_with_displayname | user2 |
# After user2 does an FS setup the share is renamed
When As an "user2"
And Downloading file "/textfile0 (2).txt" with range "bytes=10-18"
Then Downloaded content should be "test text"
When As an "user0"
And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
Then the list of returned shares has 1 shares
And share 0 is returned with
| share_type | 0 |
| uid_owner | user1 |
| displayname_owner | user1 |
| path | /textfile0 (2).txt |
| item_type | file |
| mimetype | text/plain |
| storage_id | shared::/textfile0 (2).txt |
| file_target | /textfile0 (2).txt |
| share_with | user2 |
| share_with_displayname | user2 |
Scenario: getting all shares of a file with a received share also reshared after revoking the resharing rights
Given user "user0" exists
And user "user1" exists