mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
mocking time in test only usefull when using time() once
e2513de6c6 (commitcomment-3192244)
This commit is contained in:
@ -27,10 +27,11 @@ class FileCacheTest extends CacheTest
|
||||
{
|
||||
$cache = $this->getCacheInstance();
|
||||
|
||||
static::$time = \time();
|
||||
$this->assertTrue($cache->set('expire_test', 'expire_test', 2));
|
||||
static::$time = time() + 1;
|
||||
static::$time++;
|
||||
$this->assertEquals('expire_test', $cache->get('expire_test'));
|
||||
static::$time = time() + 2;
|
||||
static::$time++;
|
||||
$this->assertFalse($cache->get('expire_test'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user