Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] Use of publicWebDAVAPIVersion on publicLocksFileLastSharedFolder function #40883

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/acceptance/features/apiWebdavLocks/publicLink.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Feature: persistent-locking in case of a public link
| new | shared |
| new | exclusive |

@smokeTest
@smokeTest @issue-40882
Scenario Outline: Public locking is not supported
Given user "Alice" has created a public link share of folder "PARENT" with change permission
When the public locks "/CHILD" in the last public link shared folder using the <public-webdav-api-version> public WebDAV API setting the following properties
Expand All @@ -93,5 +93,9 @@ Feature: persistent-locking in case of a public link
| public-webdav-api-version | lock-scope |
| old | shared |
| old | exclusive |

@skipOnOcV10
Examples:
| public-webdav-api-version | lock-scope |
| new | shared |
| new | exclusive |
| new | exclusive |
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@api @smokeTest @public_link_share-feature-required @files_sharing-app-required
Feature: persistent-locking in case of a public link


Scenario Outline: Public locking is not supported
Given user "Alice" has been created with default attributes and without skeleton files
And user "Alice" has created folder "PARENT"
And user "Alice" has created folder "PARENT/CHILD"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/parent.txt"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/CHILD/child.txt"
And user "Alice" has created a public link share of folder "PARENT" with change permission
When the public locks "/CHILD" in the last public link shared folder using the <public-webdav-api-version> public WebDAV API setting the following properties
| lockscope | <lock-scope> |
Then the HTTP status code should be "403"
Examples:
| public-webdav-api-version | lock-scope |
| new | shared |
| new | exclusive |
9 changes: 6 additions & 3 deletions tests/acceptance/features/bootstrap/WebDavLockingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class WebDavLockingContext implements Context {
* @param TableNode $properties table with no heading with | property | value |
* @param boolean $public if the file is in a public share or not
* @param boolean $expectToSucceed
* @param string $publicWebDAVAPIVersion
*
* @return void
*/
Expand All @@ -60,12 +61,13 @@ private function lockFile(
string $file,
TableNode $properties,
bool $public = false,
bool $expectToSucceed = true
bool $expectToSucceed = true,
string $publicWebDAVAPIVersion = "old"
) {
$user = $this->featureContext->getActualUsername($user);
$baseUrl = $this->featureContext->getBaseUrl();
if ($public === true) {
$type = "public-files";
$type = "public-files-$publicWebDAVAPIVersion";
$password = null;
} else {
$type = "files";
Expand Down Expand Up @@ -211,7 +213,8 @@ public function publicLocksFileLastSharedFolder(
$file,
$properties,
true,
false
false,
$publicWebDAVAPIVersion
);
}

Expand Down