From 4e6bdc168854d6bb540638ef66cb2fc0273efb21 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 19 Dec 2023 23:28:52 +0100 Subject: [PATCH 1/2] apiTest. set recipient type in body --- tests/TestHelpers/GraphHelper.php | 6 +++++- tests/acceptance/features/bootstrap/SharingNgContext.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/TestHelpers/GraphHelper.php b/tests/TestHelpers/GraphHelper.php index 192a36d7e2b..cd35e0ecd93 100644 --- a/tests/TestHelpers/GraphHelper.php +++ b/tests/TestHelpers/GraphHelper.php @@ -1579,7 +1579,8 @@ public static function getRoleIdByName( * @param string $spaceId * @param string $itemId * @param string $shareeId - * @param string|null $role + * @param string $shareType + * @param string|null $role * * @return ResponseInterface * @throws \JsonException @@ -1592,12 +1593,15 @@ public static function sendSharingInvitation( string $spaceId, string $itemId, string $shareeId, + string $shareType, ?string $role ): ResponseInterface { $url = self::getBetaFullUrl($baseUrl, "drives/$spaceId/items/$itemId/invite"); $body = []; $recipients['objectId'] = $shareeId; + $recipients['@libre.graph.recipient.type'] = $shareType; + $body['recipients'] = [$recipients]; if ($role !== null) { diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index 8ab05cfb87d..eb92be9a448 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -112,6 +112,7 @@ public function userSendsTheFollowingShareInvitationUsingTheGraphApi(string $use $spaceId, $itemId, $shareeId, + $rows['shareType'], $rows['role'] ) ); From 8f0818ebc120661334e161dddeb1aca5e819979c Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 20 Dec 2023 09:33:43 +0545 Subject: [PATCH 2/2] Fixed php style --- tests/TestHelpers/GraphHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestHelpers/GraphHelper.php b/tests/TestHelpers/GraphHelper.php index cd35e0ecd93..64ca26fc6fc 100644 --- a/tests/TestHelpers/GraphHelper.php +++ b/tests/TestHelpers/GraphHelper.php @@ -1580,7 +1580,7 @@ public static function getRoleIdByName( * @param string $itemId * @param string $shareeId * @param string $shareType - * @param string|null $role + * @param string|null $role * * @return ResponseInterface * @throws \JsonException