mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
增加queue缓存测试
This commit is contained in:
@@ -37,7 +37,7 @@ class apcTest extends cacheTestCase
|
|||||||
protected function getCacheInstance()
|
protected function getCacheInstance()
|
||||||
{
|
{
|
||||||
if (null === $this->_cacheInstance) {
|
if (null === $this->_cacheInstance) {
|
||||||
$this->_cacheInstance = new \think\cache\driver\Apc();
|
$this->_cacheInstance = new \think\cache\driver\Apc(['length' => 3]);
|
||||||
}
|
}
|
||||||
return $this->_cacheInstance;
|
return $this->_cacheInstance;
|
||||||
}
|
}
|
||||||
@@ -49,4 +49,15 @@ class apcTest extends cacheTestCase
|
|||||||
public function testExpire()
|
public function testExpire()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testQueue()
|
||||||
|
{
|
||||||
|
$cache = $this->getCacheInstance();
|
||||||
|
$this->assertTrue($cache->set('1', '1'));
|
||||||
|
$this->assertTrue($cache->set('2', '2'));
|
||||||
|
$this->assertTrue($cache->set('3', '3'));
|
||||||
|
$this->assertEquals(1, $cache->get('1'));
|
||||||
|
$this->assertTrue($cache->set('4', '4'));
|
||||||
|
$this->assertFalse($cache->get('1'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user