From 840300a12b44d6bfc2de9a640db667f1a74858e1 Mon Sep 17 00:00:00 2001 From: Thorsten Reiter Date: Sat, 29 Jun 2024 10:46:40 +0200 Subject: [PATCH] fix errors from phpstan --- .../Core/Repository/ContentService/UpdateContentTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/integration/Core/Repository/ContentService/UpdateContentTest.php b/tests/integration/Core/Repository/ContentService/UpdateContentTest.php index 80d9608aa4..ddb72de375 100644 --- a/tests/integration/Core/Repository/ContentService/UpdateContentTest.php +++ b/tests/integration/Core/Repository/ContentService/UpdateContentTest.php @@ -70,12 +70,13 @@ public function testUpdateContentHavingPrivateRelation(): void // 5. Create User that has no access to content in $privateSection $editorRole = $repository->getRoleService()->loadRole(3); + // remove existing role assignments foreach ($repository->getRoleService()->getRoleAssignments($editorRole) as $role) { - if ($role->getRoleLimitation()->limitationValues == ['/1/2/']) { - $repository->getRoleService()->removeRoleAssignment($role); - } + $repository->getRoleService()->removeRoleAssignment($role); } + $editorUserGroup = $userService->loadUserGroup(13); + // grant access to standard section $repository->getRoleService()->assignRoleToUserGroup( $editorRole, $editorUserGroup, @@ -93,6 +94,6 @@ public function testUpdateContentHavingPrivateRelation(): void // 7. Read relations & check if count($relations) is unchanged $permissionResolver->setCurrentUserReference($userService->loadUser($administratorUserId)); $relations = $contentService->loadRelations($folder->getVersionInfo()); - self::assertEquals(1, count($relations)); + self::assertEquals(1, count((array)$relations)); } }