[test-only] apiTest. change own password (#4480)

* apiTest. change own password

* fix
This commit is contained in:
Viktor Scharf
2022-08-31 13:02:33 +02:00
committed by GitHub
parent 7d39e02dc4
commit 3b548c9be3
3 changed files with 72 additions and 0 deletions
+34
View File
@@ -523,4 +523,38 @@ class GraphHelper {
}
return \json_encode($payload);
}
/**
* @param string $baseUrl
* @param string $xRequestId
* @param string $user
* @param string $password
* @param string $currentPassword
* @param string $newPassword
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function changeOwnPassword(
string $baseUrl,
string $xRequestId,
string $user,
string $password,
string $currentPassword,
string $newPassword
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'me/changePassword');
$payload['currentPassword'] = $currentPassword;
$payload['newPassword'] = $newPassword;
return HttpRequestHelper::sendRequest(
$url,
$xRequestId,
"POST",
$user,
$password,
self::getRequestHeaders(),
\json_encode($payload)
);
}
}