[tests-only] Extend API test coverage for MOVE between spaces using file-id (#8126)

* add issue tags

* extend API test coverage for MOVE between spaces using file-id

* fix table header

* re-arrange scenarios

* update expected failure

* update expected failure
This commit is contained in:
Sawjan Gurung
2024-01-04 18:00:04 +05:45
committed by GitHub
parent 0f9f996aba
commit f779ee63c3
5 changed files with 540 additions and 242 deletions
@@ -1980,16 +1980,19 @@ class SpacesContext implements Context {
*/
public function userCopiesOrMovesFileWithFileIdFromAndToSpaceBetweenSpaces(string $user, string $actionType, string $sourceFile, string $destinationFile, string $toSpaceName, string $url): void {
// split the source when there are sub-folders
$sourceFile = explode("/", $sourceFile);
$sourceFile = \trim($sourceFile, "/");
$sourceFile = \explode("/", $sourceFile);
$sourceFile = \end($sourceFile);
$destinationFile = \trim($destinationFile, "/");
$fileDestination = '';
if ($actionType === 'copies' || $actionType === 'moves') {
$fileDestination = $this->escapePath(\ltrim($destinationFile, "/")) . '/' . $this->escapePath(\ltrim(end($sourceFile), "/"));
$fileDestination = $this->escapePath($destinationFile) . '/' . $this->escapePath($sourceFile);
} elseif ($actionType === 'renames') {
$fileDestination = $destinationFile;
}
$baseUrl = $this->featureContext->getBaseUrl();
if ($toSpaceName === 'Shares') {
$sharesPath = $this->featureContext->getMountSharesPath($user, $fileDestination);
$sharesPath = $this->featureContext->getSharesMountPath($user, $fileDestination);
$davPath = WebDavHelper::getDavPath($user, $this->featureContext->getDavPathVersion());
$headers['Destination'] = $baseUrl . $davPath . $sharesPath;
} else {