mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-23 20:49:13 -05:00
[test-only] api tests for getting group info of user (#5476)
* add tests for geting group info * more tests
This commit is contained in:
@@ -1333,6 +1333,29 @@ class GraphContext implements Context {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $byUser
|
||||
* @param string|null $user
|
||||
*
|
||||
* @return ResponseInterface
|
||||
* @throws JsonException
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function retrieveUserInformationAlongWithGroupUsingGraphApi(
|
||||
string $byUser,
|
||||
?string $user = null
|
||||
):ResponseInterface {
|
||||
$user = $user ?? $byUser;
|
||||
$credentials = $this->getAdminOrUserCredentials($user);
|
||||
return GraphHelper::getUserWithGroupInformation(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$credentials["username"],
|
||||
$credentials["password"],
|
||||
$user
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^the user "([^"]*)" gets user "([^"]*)" along with (his|her) drive information using Graph API$/
|
||||
*
|
||||
@@ -1346,6 +1369,19 @@ class GraphContext implements Context {
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^the user "([^"]*)" gets user "([^"]*)" along with (his|her) group information using Graph API$/
|
||||
*
|
||||
* @param string $byUser
|
||||
* @param string $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userTriesToGetInformationOfUserAlongWithHisGroup(string $byUser, string $user) {
|
||||
$response = $this->retrieveUserInformationAlongWithGroupUsingGraphApi($byUser, $user);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @When /^the user "([^"]*)" gets (his|her) drive information using Graph API$/
|
||||
|
||||
Reference in New Issue
Block a user