mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 01:09:54 -05:00
[full-ci] getting personal space by userId instead of userName (#1553)
* getting personal space by userId instead of userName * delete geting userId via api call * add new created user id to user list * fix after review
This commit is contained in:
@@ -2333,9 +2333,9 @@ class FeatureContext extends BehatVariablesContext {
|
||||
[
|
||||
"code" => "%user_id%",
|
||||
"function" => [
|
||||
$this, "getUserIdByUserName"
|
||||
$this, "getAttributeOfCreatedUser"
|
||||
],
|
||||
"parameter" => [$userName]
|
||||
"parameter" => [$userName, 'id']
|
||||
],
|
||||
[
|
||||
"code" => "%group_id%",
|
||||
@@ -2511,8 +2511,8 @@ class FeatureContext extends BehatVariablesContext {
|
||||
[
|
||||
"code" => "%user_id%",
|
||||
"function" =>
|
||||
[$this, "getUserIdByUserName"],
|
||||
"parameter" => [$userName]
|
||||
[$this, "getAttributeOfCreatedUser"],
|
||||
"parameter" => [$userName, 'id']
|
||||
],
|
||||
[
|
||||
"code" => "%group_id%",
|
||||
@@ -2868,30 +2868,6 @@ class FeatureContext extends BehatVariablesContext {
|
||||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* The method returns userId
|
||||
*
|
||||
* @param string $userName
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public function getUserIdByUserName(string $userName): string {
|
||||
$response = GraphHelper::getUser(
|
||||
$this->getBaseUrl(),
|
||||
$this->getStepLineRef(),
|
||||
$this->getAdminUsername(),
|
||||
$this->getAdminPassword(),
|
||||
$userName
|
||||
);
|
||||
$data = \json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
|
||||
if (isset($data["id"])) {
|
||||
return $data["id"];
|
||||
} else {
|
||||
throw new Exception(__METHOD__ . " accounts-list is empty");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The method returns groupId
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user