Exemplo n.º 1
0
 /**
  * @covers Xoops\Core\Cache\Access::clear
  * @covers Xoops\Core\Cache\Access::write
  * @covers Xoops\Core\Cache\Access::read
  */
 public function testClear()
 {
     $key = 'offhand/name';
     $value = 'Fred';
     $ret = $this->object->write($key, $value);
     $this->assertTrue($ret);
     $ret = $this->object->read($key);
     $this->assertSame($ret, $value);
     $ret = $this->object->clear();
     $this->assertTrue($ret);
     $ret = $this->object->read($key);
     $this->assertFalse($ret);
 }
Exemplo n.º 2
0
 /**
  * Read value for a key from the cache
  *
  * @param string $key Identifier for the data
  *
  * @return mixed value if key was set, false not set or expired
  */
 public function read($key)
 {
     return $this->cache->read($this->prefix($key));
 }