fix: correct role lookup in user edit flow

This commit is contained in:
Marco0300
2026-09-02 00:47:21 +02:00
parent 4682e0b2a1
commit a11938ec20
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -19,5 +19,7 @@ $password = $service->validatePasswordReset(['id' => 2], 'Strong-Password-42');
user_admin_assert($password['valid'] === true, 'A strong password reset should pass.');
$front = file_get_contents(dirname(__DIR__) . '/public/index.php');
user_admin_assert($front !== false && str_contains($front, "if (\$route === 'user_edit')") && str_contains($front, "if (\$route === 'user_delete')"), 'User edit and delete routes must exist.');
user_admin_assert(str_contains($front, 'r.name AS role_name FROM users u JOIN roles r'), 'User edit must alias the role name from the roles table.');
user_admin_assert(str_contains($front, "role_name'] ?? '') !== 'Administrator'"), 'User deletion must be Administrator-only.');
printf("User administration tests: 5 passed\n");