mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-02 05:03:05 -04:00
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:<userid>` format any. It now has the same format as the permission id on "normal" driveItems.
This commit is contained in:
committed by
Ralf Haferkamp
parent
ec8733ac52
commit
44bbc07273
@@ -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 = [];
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
"""
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -1777,7 +1777,7 @@ Feature: Send a sharing invitations
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^g:%group_id_pattern%$"
|
||||
"pattern": "^%permissions_id_pattern%$"
|
||||
},
|
||||
"roles": {
|
||||
"type": "array",
|
||||
|
||||
@@ -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%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user