fix: correct role lookup in user edit flow
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user