initial 2.0.0-a4 commit

This commit is contained in:
jerry
2020-11-03 21:02:24 +08:00
parent da584e0542
commit 29fa9d8662
48 changed files with 794 additions and 1470 deletions

View File

@@ -8,14 +8,19 @@ class LightCacheTest extends TestCase
{
public function testCache() {
LightCache::init([
"size" => 2048,
"size" => 2,
"max_strlen" => 4096,
"hash_conflict_proportion" => 0.6,
"hash_conflict_proportion" => 0,
"persistence_path" => "../composer.json"
]);
//LightCache::set("bool", true);
$this->assertEquals(true, LightCache::set("2048", 123, 3));
$this->assertArrayHasKey("2048", LightCache::getAll());
sleep(3);
$this->assertArrayNotHasKey("2048", LightCache::getAll());
$this->assertEquals("Apache-2.0", LightCache::get("license"));
$this->assertEquals("zhamao/framework", LightCache::get("name"));
//$this->assertTrue(LightCache::set("storage", "asdasd", -2));
//LightCache::savePersistence();
}
}