diff --git a/tests/acceptance/features/bootstrap/TUSContext.php b/tests/acceptance/features/bootstrap/TUSContext.php index 707fb41fee2..0f7639acf39 100644 --- a/tests/acceptance/features/bootstrap/TUSContext.php +++ b/tests/acceptance/features/bootstrap/TUSContext.php @@ -69,6 +69,10 @@ public function createNewTUSResourceWithHeaders(string $user, TableNode $headers false, $password ); + $locationHeader = $response->getHeader('Location'); + if (\sizeof($locationHeader) > 0) { + $this->resourceLocation = $locationHeader[0]; + } return $response; } @@ -87,10 +91,6 @@ public function createNewTUSResourceWithHeaders(string $user, TableNode $headers public function userCreateNewTUSResourceWithHeaders(string $user, TableNode $headers, string $content = ''): void { $response = $this->createNewTUSResourceWithHeaders($user, $headers, $content); $this->featureContext->setResponse($response); - $locationHeader = $this->featureContext->getResponse()->getHeader('Location'); - if (\sizeof($locationHeader) > 0) { - $this->resourceLocation = $locationHeader[0]; - } } /** @@ -109,10 +109,6 @@ public function createNewTUSResource(string $user, TableNode $headers): void { $rows[] = ['Tus-Resumable', '1.0.0']; $response = $this->createNewTUSResourceWithHeaders($user, new TableNode($rows)); $this->featureContext->theHTTPStatusCodeShouldBe(201, "", $response); - $locationHeader = $response->getHeader('Location'); - if (\sizeof($locationHeader) > 0) { - $this->resourceLocation = $locationHeader[0]; - } } /** @@ -395,10 +391,6 @@ public function userCreatesWithUpload( ): void { $response = $this->createNewTUSResourceWithHeaders($user, $headers, $content); $this->featureContext->setResponse($response); - $locationHeader = $this->featureContext->getResponse()->getHeader('Location'); - if (\sizeof($locationHeader) > 0) { - $this->resourceLocation = $locationHeader[0]; - } } /**