mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-15 00:29:03 -06:00
[tests-only][full-ci]Added test to update role and expiration date for share link (v1beta1) (#8071)
* Added test to update role and expiration date for share link Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com> * Review address --------- Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
This commit is contained in:
@@ -75,6 +75,11 @@ trait Sharing {
|
||||
*/
|
||||
private array $createdPublicShares = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $shareNgCreatedLinkShares = [];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -98,6 +103,22 @@ trait Sharing {
|
||||
$this->createdPublicShares[] = $shareData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ResponseInterface $response
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function shareNgAddToCreatedLinkShares(ResponseInterface $response): void {
|
||||
$this->shareNgCreatedLinkShares[] = $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ResponseInterface|null
|
||||
*/
|
||||
public function shareNgGetLastCreatedLinkShare():?ResponseInterface {
|
||||
return \end($this->shareNgCreatedLinkShares);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sharer
|
||||
* @param SimpleXMLElement $shareData
|
||||
@@ -152,6 +173,17 @@ trait Sharing {
|
||||
return "/apps/files_sharing/api/v$this->sharingApiVersion/shares$postfix";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function shareNgGetLastCreatedLinkShareID(): string {
|
||||
$lastResponse = $this->shareNgGetLastCreatedLinkShare();
|
||||
if (!isset($this->getJsonDecodedResponse($lastResponse)['id'])) {
|
||||
throw new Error('Response did not contain share id ' . $this->getJsonDecodedResponse($lastResponse)['id'] . ' for the created public link');
|
||||
}
|
||||
return $this->getJsonDecodedResponse($lastResponse)['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Split given permissions string each separated with "," into array of strings
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user