Skip to content

Commit

Permalink
remove ocs endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nabim777 committed Dec 8, 2023
1 parent 71f7c1e commit 3da5b87
Showing 1 changed file with 9 additions and 34 deletions.
43 changes: 9 additions & 34 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -3120,58 +3120,33 @@ public function userTriesToSendGroupCreationRequestUsingTheAPI(string $user, str
*/
public function createTheGroup(string $group, ?string $method = null):void {
//guess yourself
if ($method === null) {
if ($this->isTestingWithLdap()) {
$method = "ldap";
} elseif (OcisHelper::isTestingWithGraphApi()) {
$method = "graph";
} else {
$method = "api";
}
}
$group = \trim($group);
$method = \trim(\strtolower($method));
$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":
if ($method === null) {
if ($this->isTestingWithLdap()) {
try {
$this->createLdapGroup($group);
} catch (LdapException $e) {
throw new Exception(
"could not create group '$group'. Error: $e"
);
}
break;
case "graph":
} elseif (OcisHelper::isTestingWithGraphApi()) {
$newGroup = $this->graphContext->adminHasCreatedGroupUsingTheGraphApi($group);
$groupCanBeDeleted = true;
$groupId = $newGroup["id"];
break;
default:
} else {
throw new InvalidArgumentException(
"Invalid method to create group '$group'"
);
}
}

$this->addGroupToCreatedGroupsList($group, true, $groupCanBeDeleted, $groupId);
Assert::assertTrue(
$this->groupExists($group),
"Group '$group' should exist but does not exist"
);
}

/**
Expand Down

0 comments on commit 3da5b87

Please sign in to comment.