tests: add api tests for changing system language using graph api (#7817)

This commit is contained in:
Swikriti Tripathi
2023-11-28 15:33:17 +05:45
committed by GitHub
parent 2811a018cf
commit 580e8aeb46
8 changed files with 85 additions and 14 deletions
+22
View File
@@ -1470,4 +1470,26 @@ class GraphHelper {
. " Cannot find share mountpoint id of '$path' for user '$user'"
);
}
/**
* @param string $baseUrl
* @param string $xRequestId
* @param string $user
* @param string $password
* @param string $language
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function switchSystemLanguage(
string $baseUrl,
string $xRequestId,
string $user,
string $password,
string $language
): ResponseInterface {
$fullUrl = self::getFullUrl($baseUrl, 'me');
$payload['preferredLanguage'] = $language;
return HttpRequestHelper::sendRequest($fullUrl, $xRequestId, 'PATCH', $user, $password, null, \json_encode($payload));
}
}