Skip to content

Commit

Permalink
Fix UserPermissions unit test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lukasbestle committed Dec 19, 2024
1 parent 0c080cf commit bcf32ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Cms/Users/UserPermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public function testChangeSingleRole()
]
]);

$app->impersonate('kirby');

Check warning on line 134 in tests/Cms/Users/UserPermissionsTest.php

View workflow job for this annotation

GitHub Actions / Unit tests - PHP 8.2

Undefined variable $app

Check warning on line 134 in tests/Cms/Users/UserPermissionsTest.php

View workflow job for this annotation

GitHub Actions / Unit tests - PHP 8.3

Undefined variable $app

Check warning on line 134 in tests/Cms/Users/UserPermissionsTest.php

View workflow job for this annotation

GitHub Actions / Unit tests - PHP 8.4

Undefined variable $app

$user = new User(['email' => '[email protected]']);
$perms = $user->permissions();

Expand Down

0 comments on commit bcf32ce

Please sign in to comment.