mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
redis驱动添加handler方法,暴露对象以调用高级方法
This commit is contained in:
@@ -47,6 +47,17 @@ class redisTest extends cacheTestCase
|
||||
|
||||
public function testStoreSpecialValues()
|
||||
{
|
||||
$redis = new \think\cache\driver\Redis(['length' => 3]);
|
||||
$redis->set('key', 'value');
|
||||
$redis->get('key');
|
||||
|
||||
$redis->handler()->setnx('key', 'value');
|
||||
$value = $redis->handler()->get('key');
|
||||
$this->assertEquals('value', $value);
|
||||
|
||||
$redis->handler()->hset('hash', 'key', 'value');
|
||||
$value = $redis->handler()->hget('hash', 'key');
|
||||
$this->assertEquals('value', $value);
|
||||
}
|
||||
|
||||
public function testExpire()
|
||||
|
||||
Reference in New Issue
Block a user