1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-31 13:20:11 +02:00

Add tests for read access to user's roles via 'Auth' interface

This commit is contained in:
Marco
2017-07-29 18:21:27 +02:00
parent c25b74d405
commit 23b172055b

View File

@@ -325,6 +325,19 @@ function showDebugData(\Delight\Auth\Auth $auth, $result) {
echo ' / ';
var_dump($auth->getStatus());
echo "\n";
echo 'Roles (super moderator)'."\t\t\t";
var_dump($auth->hasRole(\Delight\Auth\Role::SUPER_MODERATOR));
echo 'Roles (developer *or* manager)'."\t\t";
var_dump($auth->hasAnyRole(\Delight\Auth\Role::DEVELOPER, \Delight\Auth\Role::MANAGER));
echo 'Roles (developer *and* manager)'."\t\t";
var_dump($auth->hasAllRoles(\Delight\Auth\Role::DEVELOPER, \Delight\Auth\Role::MANAGER));
echo "\n";
echo '$auth->isRemembered()'."\t\t\t";
var_dump($auth->isRemembered());
echo '$auth->getIpAddress()'."\t\t\t";