[test-only] apiTest. Delete group from the space (#5365)

* add test

* add empty line
This commit is contained in:
Viktor Scharf
2023-01-10 12:03:52 +01:00
committed by GitHub
parent 1d51aab69f
commit 9bdd1e9ce9
3 changed files with 51 additions and 10 deletions
@@ -2040,11 +2040,11 @@ class SpacesContext implements Context {
}
/**
* @Given /^user "([^"]*)" has shared a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/
* @Given /^user "([^"]*)" has shared a space "([^"]*)" to (?:user|group) "([^"]*)" with role "([^"]*)"$/
*
* @param string $user
* @param string $spaceName
* @param string $userRecipient
* @param string $recipient
* @param string $role
*
* @return void
@@ -2053,10 +2053,10 @@ class SpacesContext implements Context {
public function userHasSharedSpace(
string $user,
string $spaceName,
string $userRecipient,
string $recipient,
string $role
): void {
$this->sendShareSpaceRequest($user, $spaceName, $userRecipient, $role);
$this->sendShareSpaceRequest($user, $spaceName, $recipient, $role);
$expectedHTTPStatus = "200";
$this->featureContext->theHTTPStatusCodeShouldBe(
$expectedHTTPStatus,
@@ -2067,11 +2067,11 @@ class SpacesContext implements Context {
}
/**
* @When /^user "([^"]*)" unshares a space "([^"]*)" to user "([^"]*)"$/
* @When /^user "([^"]*)" unshares a space "([^"]*)" to (?:user|group) "([^"]*)"$/
*
* @param string $user
* @param string $spaceName
* @param string $userRecipient
* @param string $recipient
*
* @return void
* @throws GuzzleException
@@ -2079,10 +2079,10 @@ class SpacesContext implements Context {
public function sendUnshareSpaceRequest(
string $user,
string $spaceName,
string $userRecipient
string $recipient
): void {
$space = $this->getSpaceByName($user, $spaceName);
$fullUrl = $this->baseUrl . $this->ocsApiUrl . "/" . $space['id'] . "?shareWith=" . $userRecipient;
$fullUrl = $this->baseUrl . $this->ocsApiUrl . "/" . $space['id'] . "?shareWith=" . $recipient;
$this->featureContext->setResponse(
HttpRequestHelper::delete(