增加queue缓存测试

This commit is contained in:
thinkphp
2016-02-28 22:31:40 +08:00
parent a4e344cdb4
commit 92e7ca7a1b

View File

@@ -37,7 +37,7 @@ class apcTest extends cacheTestCase
protected function getCacheInstance()
{
if (null === $this->_cacheInstance) {
$this->_cacheInstance = new \think\cache\driver\Apc();
$this->_cacheInstance = new \think\cache\driver\Apc(['length' => 3]);
}
return $this->_cacheInstance;
}
@@ -49,4 +49,15 @@ class apcTest extends cacheTestCase
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'));
}
}