Skip to content

Commit

Permalink
Merge pull request #40883 from owncloud/refactor-public-lock-lastshar…
Browse files Browse the repository at this point in the history
…ed-folder

[tests-only][full-ci] Use of publicWebDAVAPIVersion on publicLocksFileLastSharedFolder function
  • Loading branch information
phil-davis authored Jul 19, 2023
2 parents 8da9132 + 8b390c7 commit 9fef0fc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
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

0 comments on commit 9fef0fc

Please sign in to comment.