[full-ci][tests-only]add tests coverage for removing expiration date from shares (#8490)

* add tests coverage for removing expiration date from share link

* add coverage for folder
This commit is contained in:
Amrita
2024-02-21 14:54:40 +05:45
committed by GitHub
parent d2d4fcd43b
commit c92ebf4b46
3 changed files with 151 additions and 6 deletions
@@ -262,11 +262,11 @@ class SharingNgContext implements Context {
$body = [];
if (\array_key_exists('permissionsRole', $bodyRows)) {
$body["roles"] = [GraphHelper::getPermissionsRoleIdByName($bodyRows['permissionsRole'])];
$body['roles'] = [GraphHelper::getPermissionsRoleIdByName($bodyRows['permissionsRole'])];
}
if (\array_key_exists('expirationDateTime', $bodyRows)) {
$body["expirationDateTime"] = $bodyRows['expirationDateTime'];
$body['expirationDateTime'] = empty($bodyRows['expirationDateTime']) ? null : $bodyRows['expirationDateTime'];
}
return GraphHelper::updateShare(
@@ -357,16 +357,16 @@ class SharingNgContext implements Context {
$bodyRows = $body->getRowsHash();
$space = $bodyRows['space'];
$resource = $bodyRows['resource'];
$spaceId = ($this->spacesContext->getSpaceByName($user, $space))["id"];
$spaceId = ($this->spacesContext->getSpaceByName($user, $space))['id'];
$itemId = $this->spacesContext->getResourceId($user, $space, $resource);
$body = [];
if (\array_key_exists('permissionsRole', $bodyRows)) {
$body["link"]["type"] = $bodyRows['permissionsRole'];
$body['link']['type'] = $bodyRows['permissionsRole'];
}
if (\array_key_exists('expirationDateTime', $bodyRows)) {
$body["expirationDateTime"] = $bodyRows['expirationDateTime'];
$body['expirationDateTime'] = empty($bodyRows['expirationDateTime']) ? null : $bodyRows['expirationDateTime'];
}
return GraphHelper::updateShare(