added test to reshare resources to other users SharingNg (#8275)

This commit is contained in:
Prajwol Amatya
2024-01-24 15:45:35 +05:45
committed by GitHub
parent 9b87682f4e
commit 3b75b5b722
2 changed files with 139 additions and 3 deletions
@@ -141,9 +141,20 @@ class SharingNgContext implements Context {
$rows = $table->getRowsHash();
$spaceId = ($this->spacesContext->getSpaceByName($user, $rows['space']))["id"];
$itemId = ($rows['resourceType'] === 'folder')
? $this->spacesContext->getResourceId($user, $rows['space'], $rows['resource'])
: $this->spacesContext->getFileId($user, $rows['space'], $rows['resource']);
// for resharing a resource, "item-id" in API endpoint takes shareMountId
if ($rows['space'] === 'Shares') {
$itemId = GraphHelper::getShareMountId(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$rows['resource']
);
} else {
$itemId = ($rows['resourceType'] === 'folder')
? $this->spacesContext->getResourceId($user, $rows['space'], $rows['resource'])
: $this->spacesContext->getFileId($user, $rows['space'], $rows['resource']);
}
$sharees = array_map('trim', explode(',', $rows['sharee']));
$shareTypes = array_map('trim', explode(',', $rows['shareType']));