╔═══════════════════════════════════════════════════════════════╗ ║ 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 ───────────────────────────────────────────────────────────────── ✗ Session tests └─ No active user found - create user first ✓ IP validation └─ Invalid IP rejected ───────────────────────────────────────────────────────────────── [6] RBAC Integration ───────────────────────────────────────────────────────────────── ✗ RBAC Integration └─ No user available for testing ───────────────────────────────────────────────────────────────── [7] Exception Classes ───────────────────────────────────────────────────────────────── ✓ DatabaseException context └─ Context preserved ✓ AuthException codes └─ Code: ACCOUNT_LOCKED ✓ isUserRecoverable() └─ Correctly classifies recoverable errors ═══════════════════════════════════════════════════════════════════ SUMMARY ═══════════════════════════════════════════════════════════════════ Passed: 16 Failed: 3 Total: 19 ═══════════════════════════════════════════════════════════════════ ⚠️ Some tests failed. Check configuration and database.