[tests-only][full-ci] api test to get personal drive information of other users (#6018)

* api test to get personal drive information of other users

* fix the broken personal drive listing

* removed scenario from expected failure after issue fixed

---------

Co-authored-by: Michael Barz <mbarz@owncloud.com>
This commit is contained in:
Prajwol Amatya
2023-04-21 16:59:16 +05:45
committed by GitHub
co-authored by Michael Barz
parent 21b2973e11
commit e0b6ca0e29
4 changed files with 300 additions and 1 deletions
@@ -2293,4 +2293,28 @@ class GraphContext implements Context {
"Expected user '" . $user . "' to be added once to group '" . $group . "' but the user is listed '" . $count . "' times"
);
}
/**
* @When /^user "([^"]*)" gets the personal drive information of user "([^"]*)" using Graph API$/
* @When /^user "([^"]*)" gets own personal drive information using Graph API$/
*
* @param string $byUser
* @param string|null $user
*
* @return void
*/
public function userGetsThePersonalDriveInformationOfUserUsingGraphApi(string $byUser, ?string $user = null): void {
$user = $user ?? $byUser;
$credentials = $this->getAdminOrUserCredentials($byUser);
$userId = $this->featureContext->getAttributeOfCreatedUser($user, 'id');
$this->featureContext->setResponse(
GraphHelper::getPersonalDriveInformationByUserId(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$userId
)
);
}
}