Skip to content

Commit 0349493

Browse files
salmart-devAndyScherzinger
authored andcommitted
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>
1 parent 0862302 commit 0349493

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
@@ -878,6 +878,18 @@ public function userCreatesANewChunkingUploadWithId($user, $id) {
878878
$this->makeDavRequest($user, 'MKCOL', $destination, [], null, 'uploads');
879879
}
880880

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

0 commit comments

Comments
 (0)