remove ocs endpoint (#8043)

This commit is contained in:
Nalem7
2023-12-22 10:19:18 +05:45
committed by GitHub
parent 49705fa427
commit e245c849fc
2 changed files with 7 additions and 46 deletions

View File

@@ -942,25 +942,7 @@ class GraphContext implements Context {
$this->throwHttpException($response, "Could not create group '$group'.");
}
}
/**
* create group with provided data
*
* @param string $group
*
* @return array
* @throws Exception
* @throws GuzzleException
*/
public function adminHasCreatedGroupUsingTheGraphApi(string $group): array {
$result = $this->createGroup($group);
if ($result->getStatusCode() === 200) {
return $this->featureContext->getJsonDecodedResponse($result);
} else {
$this->throwHttpException($result, "Could not create group '$group'.");
}
}
/**
* @param ResponseInterface $response
* @param string $errorMsg

View File

@@ -3123,10 +3123,8 @@ trait Provisioning {
if ($method === null) {
if ($this->isTestingWithLdap()) {
$method = "ldap";
} elseif (OcisHelper::isTestingWithGraphApi()) {
$method = "graph";
} else {
$method = "api";
$method = "graph";
}
}
$group = \trim($group);
@@ -3134,23 +3132,6 @@ trait Provisioning {
$groupCanBeDeleted = false;
$groupId = null;
switch ($method) {
case "api":
$result = UserHelper::createGroup(
$this->getBaseUrl(),
$group,
$this->getAdminUsername(),
$this->getAdminPassword(),
$this->getStepLineRef()
);
if ($result->getStatusCode() === 200) {
$groupCanBeDeleted = true;
} else {
throw new Exception(
"could not create group '$group'. "
. $result->getStatusCode() . " " . $result->getBody()
);
}
break;
case "ldap":
try {
$this->createLdapGroup($group);
@@ -3161,7 +3142,10 @@ trait Provisioning {
}
break;
case "graph":
$newGroup = $this->graphContext->adminHasCreatedGroupUsingTheGraphApi($group);
$newGroup = $this->graphContext->createGroup($group);
if ($newGroup->getStatusCode() === 200) {
$newGroup = $this->getJsonDecodedResponse($newGroup);
}
$groupCanBeDeleted = true;
$groupId = $newGroup["id"];
break;
@@ -3616,13 +3600,8 @@ trait Provisioning {
}
return false;
}
if (OcisHelper::isTestingWithGraphApi()) {
$base = '/graph/v1.0';
} else {
$base = '/ocs/v2.php/cloud';
}
$group = \rawurlencode($group);
$fullUrl = $this->getBaseUrl() . "$base/groups/$group";
$fullUrl = $this->getBaseUrl() . "/graph/v1.0/groups/$group";
$this->response = HttpRequestHelper::get(
$fullUrl,
$this->getStepLineRef(),