Skip to content

Commit f023a6d

Browse files
salmart-devbackportbot[bot]
authored andcommitted
test: add integration test for upload case
test: add integration test for upload case Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> [skip ci]
1 parent af9b9fe commit f023a6d

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

build/integration/dav_features/webdav-related.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ Feature: webdav-related
424424
And Downloading file "/myChunkedFile.txt"
425425
Then Downloaded content should be "AAAAABBBBBCCCCC"
426426

427+
Scenario: Cannot create a chunked upload in another user's uploads folder
428+
Given using new dav path
429+
And user "user0" exists
430+
And user "user1" exists
431+
And As an "user1"
432+
When user "user1" creates a new chunking upload with id "chunking-42" in the uploads folder for "user0"
433+
Then the HTTP status code should be "403"
434+
427435
Scenario: A disabled user cannot use webdav
428436
Given user "userToBeDisabled" exists
429437
And As an "admin"

build/integration/features/bootstrap/WebDav.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,18 @@ public function userCreatesANewChunkingUploadWithId($user, $id) {
879879
$this->makeDavRequest($user, 'MKCOL', $destination, [], null, 'uploads');
880880
}
881881

882+
/**
883+
* @When user :user creates a new chunking upload with id :id in the uploads folder for :uidOrToken
884+
*/
885+
public function userCreatesANewChunkingUploadWithIdInFolderOf($user, $id, $uidOrToken): void {
886+
$destination = '/uploads/' . $uidOrToken . '/' . $id;
887+
try {
888+
$this->response = $this->makeDavRequest($user, 'MKCOL', $destination, [], null, 'uploads');
889+
} catch (\GuzzleHttp\Exception\ClientException $e) {
890+
$this->response = $e->getResponse();
891+
}
892+
}
893+
882894
/**
883895
* @Given user :user uploads new chunk file :num with :data to id :id
884896
*/

0 commit comments

Comments
 (0)