getProperty('connectionAttempted'); $connAttempted->setAccessible(true); $connAttempted->setValue(null, false); $clientProp = $ref->getProperty('client'); $clientProp->setAccessible(true); $clientProp->setValue(null, null); $res = Cache::set('test_cache_key', ['hello' => 'world'], 30); if ($res) { echo " ✅ Successfully set value in Redis.\n"; $val = Cache::get('test_cache_key'); if (isset($val['hello']) && $val['hello'] === 'world') { echo " ✅ Successfully retrieved value from Redis: " . json_encode($val) . "\n"; } else { echo " ❌ Failed to get correct value from Redis.\n"; } Cache::delete('test_cache_key'); } else { echo " ℹ️ Redis server is not running or unreachable (Fallback triggered, test completed successfully).\n"; } } catch (\Exception $e) { echo " Reflection or execution error: " . $e->getMessage() . "\n"; } } else { echo "\n2. Redis extension (phpredis) not installed. Native database fallback remains active.\n"; } echo "\n=== Redis Caching Tests Completed ===\n";