Skip to content

Commit

Permalink
adds status check on given steps of tus upload
Browse files Browse the repository at this point in the history
Signed-off-by: nabim777 <[email protected]>
  • Loading branch information
nabim777 committed Jan 6, 2025
1 parent 444ddb3 commit 918dca1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/acceptance/bootstrap/SpacesTUSContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ public function userHasUploadedFileViaTusInSpace(
string $spaceName
): void {
$spaceId = $this->spacesContext->getSpaceIdByName($user, $spaceName);
$this->tusContext->uploadFileUsingTus($user, $source, $destination, $spaceId);
$response = $this->tusContext->uploadFileUsingTus($user, $source, $destination, $spaceId);
$this->featureContext->setLastUploadDeleteTime(\time());
$this->featureContext->theHTTPStatusCodeShouldBe(
["201", "204"],
"HTTP status code was not 201 or 204 while trying to upload file '$destination' for user '$user'",
$response
);
}

/**
Expand Down Expand Up @@ -259,7 +264,12 @@ public function userHasUploadedAFileWithContentToViaTusInsideOfTheSpace(
string $resource,
string $spaceName
): void {
$this->uploadFileViaTus($user, $content, $resource, $spaceName);
$response = $this->uploadFileViaTus($user, $content, $resource, $spaceName);
$this->featureContext->theHTTPStatusCodeShouldBe(
["201", "204"],
"HTTP status code was not 201 or 204 while trying to upload file '$resource' for user '$user'",
$response
);
}

/**
Expand Down

0 comments on commit 918dca1

Please sign in to comment.