From 44bbc07273d5a323c6d9c96ba5a4954fb02ae9df Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 25 Mar 2026 18:45:22 +0100 Subject: [PATCH] tests: Adjust acceptance test for recent Space sharing changes The `id` property of the `permissions` on a space root does not longer have that special `u:` format any. It now has the same format as the permission id on "normal" driveItems. --- .../acceptance/bootstrap/SharingNgContext.php | 23 +++++++----------- .../apiSharingNg1/listPermissions.feature | 10 ++++---- .../features/apiSharingNg1/sharedByMe.feature | 4 ++-- .../shareInvitations.feature | 2 +- .../updateShareInvitations.feature | 24 +++++++++---------- 5 files changed, 29 insertions(+), 34 deletions(-) diff --git a/tests/acceptance/bootstrap/SharingNgContext.php b/tests/acceptance/bootstrap/SharingNgContext.php index 7f9be3b011..df64e47e96 100644 --- a/tests/acceptance/bootstrap/SharingNgContext.php +++ b/tests/acceptance/bootstrap/SharingNgContext.php @@ -420,7 +420,7 @@ class SharingNgContext implements Context { $expirationDateTime = (\array_key_exists('expirationDateTime', $rows)) ? \date(DATE_RFC3339, \strtotime($rows['expirationDateTime'])) : null; - return GraphHelper::sendSharingInvitationForDrive( + $response = GraphHelper::sendSharingInvitationForDrive( $this->featureContext->getBaseUrl(), $this->featureContext->getStepLineRef(), $user, @@ -432,6 +432,10 @@ class SharingNgContext implements Context { $permissionsAction, $expirationDateTime ); + if ($response->getStatusCode() === 200) { + $this->featureContext->shareNgAddToCreatedUserGroupShares($response); + } + return $response; } /** @@ -651,12 +655,7 @@ class SharingNgContext implements Context { string $sharee, TableNode $table ) { - $permissionID = ""; - if ($shareType === "user") { - $permissionID = "u:" . $this->featureContext->getAttributeOfCreatedUser($sharee, 'id'); - } elseif ($shareType === "group") { - $permissionID = "g:" . $this->featureContext->getAttributeOfCreatedGroup($sharee, 'id'); - } + $permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID(); $this->featureContext->setResponse( $this->updateResourceShare( @@ -1042,8 +1041,8 @@ class SharingNgContext implements Context { $permissionID = match ($shareType) { 'link' => $this->featureContext->shareNgGetLastCreatedLinkShareID(), - 'user' => 'u:' . $this->featureContext->getAttributeOfCreatedUser($recipient, 'id'), - 'group' => 'g:' . $this->featureContext->getAttributeOfCreatedGroup($recipient, 'id'), + 'user' => $this->featureContext->shareNgGetLastCreatedUserGroupShareID(), + 'group' => $this->featureContext->shareNgGetLastCreatedUserGroupShareID(), default => throw new Exception("shareType '$shareType' does not match user|group|link "), }; @@ -1650,11 +1649,7 @@ class SharingNgContext implements Context { TableNode $table ): void { $bodyRows = $table->getRowsHash(); - $permissionID = match ($bodyRows['shareType']) { - 'user' => 'u:' . $this->featureContext->getAttributeOfCreatedUser($bodyRows['sharee'], 'id'), - 'group' => 'g:' . $this->featureContext->getAttributeOfCreatedGroup($bodyRows['sharee'], 'id'), - default => throw new Exception("shareType {$bodyRows['shareType']} does not match user|group "), - }; + $permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID(); $space = $bodyRows['space']; $spaceId = ($this->spacesContext->getSpaceByName($user, $space))["id"]; $body = []; diff --git a/tests/acceptance/features/apiSharingNg1/listPermissions.feature b/tests/acceptance/features/apiSharingNg1/listPermissions.feature index 1e1c62ea73..0c44e084e3 100644 --- a/tests/acceptance/features/apiSharingNg1/listPermissions.feature +++ b/tests/acceptance/features/apiSharingNg1/listPermissions.feature @@ -414,7 +414,7 @@ Feature: List a sharing permissions }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -456,7 +456,7 @@ Feature: List a sharing permissions }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1428,7 +1428,7 @@ Feature: List a sharing permissions }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1470,7 +1470,7 @@ Feature: List a sharing permissions }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -2769,4 +2769,4 @@ Feature: List a sharing permissions } } } - """ \ No newline at end of file + """ diff --git a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature index 2b4d69ae60..1223b03c23 100644 --- a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature +++ b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature @@ -3407,7 +3407,7 @@ Feature: resources shared by user "name", "id", "eTag", - "folder", + "root", "lastModifiedDateTime", "size" ], @@ -3415,7 +3415,7 @@ Feature: resources shared by user "name": { "const": "." }, - "folder": { + "root": { "const": {} }, "id": { diff --git a/tests/acceptance/features/apiSharingNgShareInvitation/shareInvitations.feature b/tests/acceptance/features/apiSharingNgShareInvitation/shareInvitations.feature index 55813fcb69..1e81e376e4 100644 --- a/tests/acceptance/features/apiSharingNgShareInvitation/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNgShareInvitation/shareInvitations.feature @@ -1777,7 +1777,7 @@ Feature: Send a sharing invitations }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", diff --git a/tests/acceptance/features/apiSharingNgShareInvitation/updateShareInvitations.feature b/tests/acceptance/features/apiSharingNgShareInvitation/updateShareInvitations.feature index e8addc6a84..ad024c0069 100644 --- a/tests/acceptance/features/apiSharingNgShareInvitation/updateShareInvitations.feature +++ b/tests/acceptance/features/apiSharingNgShareInvitation/updateShareInvitations.feature @@ -278,7 +278,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -437,7 +437,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -517,7 +517,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -602,7 +602,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -680,7 +680,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -766,7 +766,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^g:%group_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -842,7 +842,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -918,7 +918,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1000,7 +1000,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1077,7 +1077,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1159,7 +1159,7 @@ Feature: Update permission of a share }, "id": { "type": "string", - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" }, "roles": { "type": "array", @@ -1417,7 +1417,7 @@ Feature: Update permission of a share } }, "id": { - "pattern": "^u:%user_id_pattern%$" + "pattern": "^%permissions_id_pattern%$" } } }