diff --git a/tests/acceptance/features/bootstrap/SpacesTUSContext.php b/tests/acceptance/features/bootstrap/SpacesTUSContext.php index 1c1149182e7..c0639884f1a 100644 --- a/tests/acceptance/features/bootstrap/SpacesTUSContext.php +++ b/tests/acceptance/features/bootstrap/SpacesTUSContext.php @@ -57,8 +57,8 @@ public function before(BeforeScenarioScope $scope): void { * @throws GuzzleException */ public function userHasUploadedFileViaTusInSpace(string $user, string $source, string $destination, string $spaceName): void { - $this->userUploadsAFileViaTusInsideOfTheSpaceUsingTheWebdavApi($user, $source, $destination, $spaceName); - $this->featureContext->theHTTPStatusCodeShouldBe(200, "Expected response status code should be 200"); + $this->spacesContext->setSpaceIDByName($user, $spaceName); + $this->tusContext->userUploadsUsingTusAFileTo($user, $source, $destination); } /** @@ -102,8 +102,9 @@ public function userHasCreatedANewTusResourceForTheSpaceUsingTheWebdavApiWithThe string $content, TableNode $headers ): void { - $this->userCreatesANewTusResourceForTheSpaceUsingTheWebdavApiWithTheseHeaders($user, $spaceName, $content, $headers); - $this->featureContext->theHTTPStatusCodeShouldBe(201, "Expected response status code should be 201"); + $this->spacesContext->setSpaceIDByName($user, $spaceName); + $response = $this->tusContext->createNewTUSResourceWithHeaders($user, $headers, $content); + $this->featureContext->theHTTPStatusCodeShouldBe(201, "Expected response status code should be 201", $response); } /** @@ -152,7 +153,7 @@ public function userUploadsAFileWithContentToViaTusInsideOfTheSpaceUsingTheWebda } /** - * @When /^user "([^"]*)" has uploaded a file with content "([^"]*)" to "([^"]*)" via TUS inside of the space "([^"]*)"$/ + * @Given /^user "([^"]*)" has uploaded a file with content "([^"]*)" to "([^"]*)" via TUS inside of the space "([^"]*)"$/ * * @param string $user * @param string $content @@ -169,10 +170,6 @@ public function userHasUploadedAFileWithContentToViaTusInsideOfTheSpace( string $spaceName ): void { $this->userUploadsAFileWithContentToViaTusInsideOfTheSpaceUsingTheWebdavApi($user, $content, $resource, $spaceName); - $this->featureContext->theHTTPStatusCodeShouldBe( - 200, - "Expected response status code should be 200" - ); } /** @@ -243,7 +240,7 @@ public function userHasUploadedFileWithChecksumToTheLastCreatedTusLocationWithOf } /** - * @Given /^user "([^"]*)" uploads file with checksum "([^"]*)" to the last created TUS Location with offset "([^"]*)" and content "([^"]*)" via TUS inside of the space "([^"]*)" using the WebDAV API$/ + * @When /^user "([^"]*)" uploads file with checksum "([^"]*)" to the last created TUS Location with offset "([^"]*)" and content "([^"]*)" via TUS inside of the space "([^"]*)" using the WebDAV API$/ * * @param string $user * @param string $checksum @@ -262,7 +259,8 @@ public function userUploadsFileWithChecksumToTheLastCreatedTusLocationWithOffset string $spaceName ): void { $this->spacesContext->setSpaceIDByName($user, $spaceName); - $this->tusContext->userUploadsFileWithChecksum($user, $checksum, $offset, $content); + $response = $this->tusContext->sendsAChunkToTUSLocationWithOffsetAndData($user, $offset, $content, $checksum); + $this->featureContext->setResponse($response); } /**