Skip to content

Commit 9fef0fc

Browse files
authored
Merge pull request #40883 from owncloud/refactor-public-lock-lastshared-folder
[tests-only][full-ci] Use of publicWebDAVAPIVersion on publicLocksFileLastSharedFolder function
2 parents 8da9132 + 8b390c7 commit 9fef0fc

3 files changed

Lines changed: 30 additions & 5 deletions

File tree

tests/acceptance/features/apiWebdavLocks/publicLink.feature

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Feature: persistent-locking in case of a public link
8282
| new | shared |
8383
| new | exclusive |
8484

85-
@smokeTest
85+
@smokeTest @issue-40882
8686
Scenario Outline: Public locking is not supported
8787
Given user "Alice" has created a public link share of folder "PARENT" with change permission
8888
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
@@ -93,5 +93,9 @@ Feature: persistent-locking in case of a public link
9393
| public-webdav-api-version | lock-scope |
9494
| old | shared |
9595
| old | exclusive |
96+
97+
@skipOnOcV10
98+
Examples:
99+
| public-webdav-api-version | lock-scope |
96100
| new | shared |
97-
| new | exclusive |
101+
| new | exclusive |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@api @smokeTest @public_link_share-feature-required @files_sharing-app-required
2+
Feature: persistent-locking in case of a public link
3+
4+
5+
Scenario Outline: Public locking is not supported
6+
Given user "Alice" has been created with default attributes and without skeleton files
7+
And user "Alice" has created folder "PARENT"
8+
And user "Alice" has created folder "PARENT/CHILD"
9+
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/parent.txt"
10+
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "PARENT/CHILD/child.txt"
11+
And user "Alice" has created a public link share of folder "PARENT" with change permission
12+
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
13+
| lockscope | <lock-scope> |
14+
Then the HTTP status code should be "403"
15+
Examples:
16+
| public-webdav-api-version | lock-scope |
17+
| new | shared |
18+
| new | exclusive |

tests/acceptance/features/bootstrap/WebDavLockingContext.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class WebDavLockingContext implements Context {
5252
* @param TableNode $properties table with no heading with | property | value |
5353
* @param boolean $public if the file is in a public share or not
5454
* @param boolean $expectToSucceed
55+
* @param string $publicWebDAVAPIVersion
5556
*
5657
* @return void
5758
*/
@@ -60,12 +61,13 @@ private function lockFile(
6061
string $file,
6162
TableNode $properties,
6263
bool $public = false,
63-
bool $expectToSucceed = true
64+
bool $expectToSucceed = true,
65+
string $publicWebDAVAPIVersion = "old"
6466
) {
6567
$user = $this->featureContext->getActualUsername($user);
6668
$baseUrl = $this->featureContext->getBaseUrl();
6769
if ($public === true) {
68-
$type = "public-files";
70+
$type = "public-files-$publicWebDAVAPIVersion";
6971
$password = null;
7072
} else {
7173
$type = "files";
@@ -211,7 +213,8 @@ public function publicLocksFileLastSharedFolder(
211213
$file,
212214
$properties,
213215
true,
214-
false
216+
false,
217+
$publicWebDAVAPIVersion
215218
);
216219
}
217220

0 commit comments

Comments
 (0)