[test-only] add test for uploading with Tus using CORS (#8508)
* add test for uploading with Tus using CORS * fix
This commit is contained in:
@@ -286,6 +286,29 @@ class SpacesTUSContext implements Context {
|
||||
$this->tusContext->userUploadsChunkFileWithChecksum($user, $offset, $data, $checksum);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" sends a chunk to the last created TUS Location with data "([^"]*)" inside of the space "([^"]*)" with headers:$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $data
|
||||
* @param string $spaceName
|
||||
* @param TableNode $headers
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function userSendsAChunkToTheLastCreatedTusLocationWithDataInsideOfTheSpaceWithHeaders(
|
||||
string $user,
|
||||
string $data,
|
||||
string $spaceName,
|
||||
TableNode $headers
|
||||
): void {
|
||||
$this->spacesContext->setSpaceIDByName($user, $spaceName);
|
||||
$rows = $headers->getRowsHash();
|
||||
$response = $this->tusContext->sendsAChunkToTUSLocationWithOffsetAndData($user, $rows['Upload-Offset'], $data, $rows['Upload-Checksum'], ['Origin' => $rows['Origin']]);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" overwrites recently shared file with offset "([^"]*)" and data "([^"]*)" with checksum "([^"]*)" via TUS inside of the space "([^"]*)" using the WebDAV API with these headers:$/
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user