From a2be4c61eed060d139003c807f81c93fe2b26c47 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 10 Mar 2018 03:05:41 +0100 Subject: [PATCH] Add tests for method 'getRolesForUserById' from class 'Administration' --- tests/index.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/index.php b/tests/index.php index a3df777..8578030 100644 --- a/tests/index.php +++ b/tests/index.php @@ -523,6 +523,19 @@ function processRequestData(\Delight\Auth\Auth $auth) { return 'ID required'; } } + else if ($_POST['action'] === 'admin.getRoles') { + if (isset($_POST['id'])) { + try { + return $auth->admin()->getRolesForUserById($_POST['id']); + } + catch (\Delight\Auth\UnknownIdException $e) { + return 'unknown ID'; + } + } + else { + return 'ID required'; + } + } else if ($_POST['action'] === 'admin.logInAsUserById') { if (isset($_POST['id'])) { try { @@ -880,6 +893,12 @@ function showGuestUserForm() { echo ''; echo ''; + echo '
'; + echo ''; + echo ' '; + echo ''; + echo '
'; + echo '
'; echo ''; echo ' ';