╔═══════════════════════════════════════════════════════════════╗ ║ RBAC Models Test Suite v1.0.0 ║ ║ Schema: schema_rbac_system_final.sql ║ ╚═══════════════════════════════════════════════════════════════╝ ───────────────────────────────────────────────────────────────── [1] Database Connection ───────────────────────────────────────────────────────────────── ✓ Singleton instantiation ✓ Singleton pattern └─ Same instance returned ───────────────────────────────────────────────────────────────── [2] User Model ───────────────────────────────────────────────────────────────── ✓ findByEmail() └─ No user found (expected if DB empty) ✓ Email validation ✓ Password strength validation └─ All weak passwords rejected ✗ Strong password format └─ Should fail on non-existent user ───────────────────────────────────────────────────────────────── [3] Role Model ───────────────────────────────────────────────────────────────── ✓ findByName() └─ Found: admin ✓ getPermissions() └─ 9 permissions found ✓ getUsers() └─ 0 users with admin role ✓ getAllRoles() └─ 5 roles in system ───────────────────────────────────────────────────────────────── [4] Permission Model ───────────────────────────────────────────────────────────────── ✓ findByResourceAction() └─ Found: dashboard.view ✓ getAllGroupedByResource() └─ 6 resources ✓ getDistinctResources() └─ analytics, dashboard, roles, session, settings ───────────────────────────────────────────────────────────────── [5] Session Model ───────────────────────────────────────────────────────────────── ✓ createSession() └─ ID length: 128 ✓ validateSession() └─ Session valid ✓ markAsTrusted() └─ Device marked trusted for 30 days ✓ getUserActiveSessions() └─ 2 active sessions ✓ destroySession() └─ Test session cleaned up ✓ IP validation └─ Invalid IP rejected ───────────────────────────────────────────────────────────────── [6] RBAC Integration ───────────────────────────────────────────────────────────────── ✓ User.getRoles() └─ 0 roles assigned ✓ User.getPermissions() └─ 0 permissions aggregated ✓ User.hasPermission() └─ No dashboard.view ✓ Permission boundary └─ secret.nuke correctly denied ───────────────────────────────────────────────────────────────── [7] Exception Classes ───────────────────────────────────────────────────────────────── ✓ DatabaseException context └─ Context preserved ✓ AuthException codes └─ Code: ACCOUNT_LOCKED ✓ isUserRecoverable() └─ Correctly classifies recoverable errors ═══════════════════════════════════════════════════════════════════ SUMMARY ═══════════════════════════════════════════════════════════════════ Passed: 25 Failed: 1 Total: 26 ═══════════════════════════════════════════════════════════════════ ⚠️ Some tests failed. Check configuration and database.