mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-23 05:59:28 -06:00
fix flaky test apiSpacesShares/shareSpaces.feature:42 (#5545)
This commit is contained in:
committed by
GitHub
parent
f0319652a9
commit
0f31ed196a
@@ -3278,17 +3278,13 @@ class SpacesContext implements Context {
|
||||
);
|
||||
Assert::assertIsArray($spaceAsArray = $this->getSpaceByNameFromResponse($spaceName), "No space with name $spaceName found");
|
||||
$recipientType === 'user' ? $recipientId = $this->getUserIdByUserName($recipient) : $recipientId = $this->getGroupIdByGroupName($recipient);
|
||||
|
||||
$recipientId = $this->getUserIdByUserName($user);
|
||||
$foundRoleInResponse = false;
|
||||
foreach ($spaceAsArray['root']['permissions'] as $permission) {
|
||||
$foundRoleInResponse = false;
|
||||
if (\array_key_exists($recipientType, $permission['grantedToIdentities'][0])) {
|
||||
if ($permission['roles'][0] === $role || $permission['grantedToIdentities'][0][$recipientType]['id'] === $recipientId) {
|
||||
$foundRoleInResponse = true;
|
||||
break;
|
||||
}
|
||||
Assert::assertTrue($foundRoleInResponse, "the response does not contain the $recipientType $recipient");
|
||||
if (isset($permission['grantedToIdentities'][0][$recipientType]) && $permission['roles'][0] === $role && $permission['grantedToIdentities'][0][$recipientType]['id'] === $recipientId) {
|
||||
$foundRoleInResponse = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Assert::assertTrue($foundRoleInResponse, "the response does not contain the $recipientType $recipient");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user