refactored redis cache, added mset()

This commit is contained in:
Carsten Brandt
2013-11-17 21:09:13 +01:00
parent a0824422b2
commit 09a3300b7c
8 changed files with 125 additions and 42 deletions

View File

@@ -45,6 +45,17 @@ class RedisCacheTest extends CacheTestCase
$this->assertFalse($cache->get('expire_test_ms'));
}
public function testExpireAddMilliseconds()
{
$cache = $this->getCacheInstance();
$this->assertTrue($cache->add('expire_testa_ms', 'expire_testa_ms', 0.2));
usleep(100000);
$this->assertEquals('expire_testa_ms', $cache->get('expire_testa_ms'));
usleep(300000);
$this->assertFalse($cache->get('expire_testa_ms'));
}
/**
* Store a value that is 2 times buffer size big
* https://github.com/yiisoft/yii2/issues/743