Skip to content

Commit 43a6e64

Browse files
committed
refactor use of webdavapiversion on public lock and bug demonstration
1 parent f65b7cc commit 43a6e64

3 files changed

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

tests/acceptance/features/bootstrap/WebDavLockingContext.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ private function lockFile(
6060
string $file,
6161
TableNode $properties,
6262
bool $public = false,
63-
bool $expectToSucceed = true
63+
bool $expectToSucceed = true,
64+
string $publicWebDAVAPIVersion = "old"
6465
) {
6566
$user = $this->featureContext->getActualUsername($user);
6667
$baseUrl = $this->featureContext->getBaseUrl();
6768
if ($public === true) {
68-
$type = "public-files";
69+
$type = "public-files-$publicWebDAVAPIVersion";
6970
$password = null;
7071
} else {
7172
$type = "files";
@@ -211,7 +212,8 @@ public function publicLocksFileLastSharedFolder(
211212
$file,
212213
$properties,
213214
true,
214-
false
215+
false,
216+
$publicWebDAVAPIVersion
215217
);
216218
}
217219

0 commit comments

Comments
 (0)