fix: qualify user columns in edit lookup

This commit is contained in:
Marco0300
2026-09-02 00:50:06 +02:00
parent 3f639d827f
commit 9f149c61be
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -19,7 +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, 'SELECT u.id, u.name, u.email, u.role_id, u.is_active, r.name AS role_name FROM users u JOIN roles r'), 'User edit must qualify user columns when joining 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");