mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 09:15:37 +08:00
initial 2.0.0-a2 commit
This commit is contained in:
21
test/LightCacheTest.php
Normal file
21
test/LightCacheTest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user