Пример #1
0
 public function testSetHasGetRemove()
 {
     $expected = 'some random value string';
     $key = __METHOD__;
     $this->assertEquals($this->obj, $this->obj->set($key, $expected));
     $this->assertTrue($this->obj->has($key));
     $this->assertFalse($this->obj->has($key, __CLASS__));
     $this->assertEquals($expected, $this->obj->get($key));
     $this->assertNull($this->obj->get($key, __CLASS__));
     $this->assertEquals($this->obj, $this->obj->remove($key));
     $this->assertFalse($this->obj->has($key));
     $this->assertNull($this->obj->get($key));
 }
Пример #2
0
 public function testKeysCanBeDeleted()
 {
     $val = uniqid();
     $this->cache->set('name', $val);
     $this->assertTrue($this->cache->has('name'));
     $this->cache->del('name');
     $this->assertFalse($this->cache->has('name'));
 }
Пример #3
0
 public function testValuesCanBeSetThenReadAndIsThenUnset()
 {
     $this->cache->set('name', 'Marcos');
     $this->cache->get('name');
     $this->assertFalse($this->cache->has('name'));
 }