add tests for searching user with filter

This commit is contained in:
amrita
2025-05-09 17:07:52 +05:45
parent 9a3c4aeb14
commit 4d9dfe16e5
4 changed files with 391 additions and 891 deletions

View File

@@ -2283,4 +2283,33 @@ class GraphHelper {
self::getRequestHeaders()
);
}
/**
* @param string $baseUrl
* @param string $user
* @param string $password
* @param string $groupId
* @param string $searchTerm
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function searchUserWithFilterMemberOf(
string $baseUrl,
string $user,
string $password,
string $groupId,
string $searchTerm
): ResponseInterface {
$url = self::getFullUrl(
$baseUrl,
'users' . '?$filter=memberOf/any(m:m/id ' . "eq '$groupId')" . '&$search=' . "$searchTerm"
);
return HttpRequestHelper::get(
$url,
$user,
$password,
self::getRequestHeaders()
);
}
}