mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进缓存驱动测试的有效期测试
This commit is contained in:
@@ -114,10 +114,10 @@ abstract class cacheTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
public function testExpire()
|
public function testExpire()
|
||||||
{
|
{
|
||||||
$cache = $this->getCacheInstance();
|
$cache = $this->getCacheInstance();
|
||||||
$this->assertTrue($cache->set('expire_test', 'expire_test', 2));
|
$this->assertTrue($cache->set('expire_test', 'expire_test', 1));
|
||||||
usleep(500000);
|
usleep(600000);
|
||||||
$this->assertEquals('expire_test', $cache->get('expire_test'));
|
$this->assertEquals('expire_test', $cache->get('expire_test'));
|
||||||
usleep(2500000);
|
usleep(800000);
|
||||||
$this->assertFalse($cache->get('expire_test'));
|
$this->assertFalse($cache->get('expire_test'));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class debugTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testGetUseTime()
|
public function testGetUseTime()
|
||||||
{
|
{
|
||||||
$time = \think\Debug::getUseTime();
|
$time = \think\Debug::getUseTime();
|
||||||
$this->assertLessThan(3.5, $time);
|
$this->assertLessThan(5.5, $time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user