[test-only] api tests for getting group info of user (#5476)

* add tests for geting group info

* more tests
This commit is contained in:
Viktor Scharf
2023-02-01 08:41:16 +01:00
committed by GitHub
parent e1a4ac6b33
commit 0bf121d2e2
4 changed files with 85 additions and 0 deletions
@@ -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$/