From bcf32ce8d517d35d317557492273fb375a23115a Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Thu, 19 Dec 2024 21:59:52 +0100 Subject: [PATCH] Fix `UserPermissions` unit test Without having a current user, the permission would be `false` even if the logic test in `canChangeRole()` would not work, thus making the test useless --- tests/Cms/Users/UserPermissionsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Cms/Users/UserPermissionsTest.php b/tests/Cms/Users/UserPermissionsTest.php index 9c2f87e51f..695806b6cd 100644 --- a/tests/Cms/Users/UserPermissionsTest.php +++ b/tests/Cms/Users/UserPermissionsTest.php @@ -131,6 +131,8 @@ public function testChangeSingleRole() ] ]); + $app->impersonate('kirby'); + $user = new User(['email' => 'test@getkirby.com']); $perms = $user->permissions();