Overwriting a file while moving and moving
This commit is contained in:
@@ -1673,6 +1673,38 @@ class SpacesContext implements Context {
|
||||
$this->copyFilesAndFoldersRequest($user, $fullUrl, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" overwrites file "([^"]*)" from space "([^"]*)" to "([^"]*)" inside space "([^"]*)" while (copying|moving)\s? using the WebDAV API$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $fileSource
|
||||
* @param string $fromSpaceName
|
||||
* @param string $fileDestination
|
||||
* @param string $toSpaceName
|
||||
* @param string $action
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function userOverwritesFileFromAndToSpaceBetweenSpaces(
|
||||
string $user,
|
||||
string $fileSource,
|
||||
string $fromSpaceName,
|
||||
string $fileDestination,
|
||||
string $toSpaceName,
|
||||
string $action
|
||||
):void {
|
||||
$space = $this->getSpaceByName($user, $fromSpaceName);
|
||||
$headers['Destination'] = $this->destinationHeaderValueWithSpaceName($user, $fileDestination, $toSpaceName);
|
||||
$headers['Overwrite'] = 'T';
|
||||
$fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($fileSource, "/");
|
||||
if ($action === 'copying') {
|
||||
$this->copyFilesAndFoldersRequest($user, $fullUrl, $headers);
|
||||
} else {
|
||||
$this->moveFilesAndFoldersRequest($user, $fullUrl, $headers);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^user "([^"]*)" should not be able to download file "([^"]*)" from space "([^"]*)"$/
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user