Refactor test for updating the share (#5775)

This commit is contained in:
Swikriti Tripathi authored and GitHub committed 2023-03-09 17:27:31 +05:45
1 parent 996565cc6e
commit b856f6546c
2 files changed
+2 -9

No files matched your search

@@ -2376,7 +2376,7 @@ trait Sharing {
} }
/** /**
* @When the information about the last share for user :user should include * @Then the information about the last share for user :user should include
* *
* @param string $user * @param string $user
* @param TableNode $table * @param TableNode $table
@@ -2015,13 +2015,6 @@ class SpacesContext implements Context {
): void { ): void {
$shareId = $this->featureContext->getLastPublicLinkShareId(); $shareId = $this->featureContext->getLastPublicLinkShareId();
$rows = $table->getRowsHash(); $rows = $table->getRowsHash();
$rows["role"] = \array_key_exists("role", $rows) ? $rows["role"] : 'viewer';
$rows["expireDate"] = \array_key_exists("expireDate", $rows) ? $rows["expireDate"] : null;
$body = [
"expireDate" => $rows["expireDate"],
];
$fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId; $fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId;
$this->featureContext->setResponse( $this->featureContext->setResponse(
HttpRequestHelper::sendRequest( HttpRequestHelper::sendRequest(
@@ -2031,7 +2024,7 @@ class SpacesContext implements Context {
$this->featureContext->getActualUsername($user), $this->featureContext->getActualUsername($user),
$this->featureContext->getPasswordForUser($user), $this->featureContext->getPasswordForUser($user),
null, null,
$body $rows
) )
); );
} }