mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-19 05:34:53 +08:00
22 lines
554 B
PHP
22 lines
554 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
use ZM\Store\LightCache;
|
||
|
|
|
||
|
|
class LightCacheTest extends TestCase
|
||
|
|
{
|
||
|
|
public function testCache() {
|
||
|
|
LightCache::init([
|
||
|
|
"size" => 2048,
|
||
|
|
"max_strlen" => 4096,
|
||
|
|
"hash_conflict_proportion" => 0.6,
|
||
|
|
]);
|
||
|
|
//LightCache::set("bool", true);
|
||
|
|
$this->assertEquals(true, LightCache::set("2048", 123, 3));
|
||
|
|
$this->assertArrayHasKey("2048", LightCache::getAll());
|
||
|
|
sleep(3);
|
||
|
|
$this->assertArrayNotHasKey("2048", LightCache::getAll());
|
||
|
|
}
|
||
|
|
}
|