Пример #1
0
 /**
  * Test that values can be cleared correctly.
  *
  * @depends testBootstrap
  *
  * @covers Molovo\Amnesia\Cache\Instance::clear
  * @covers Molovo\Amnesia\Driver\File::clear
  *
  * @uses Molovo\Amnesia\Cache\Instance::mset
  * @uses Molovo\Amnesia\Cache\Instance::mget
  * @uses Molovo\Amnesia\Cache\Instance::encode
  * @uses Molovo\Amnesia\Cache\Instance::decode
  * @uses Molovo\Amnesia\Driver\File::mset
  * @uses Molovo\Amnesia\Driver\File::mget
  */
 public function testClear()
 {
     static::$instance->set('key', 'value');
     $value = static::$instance->get('key');
     verify($value)->equals('value');
     static::$instance->clear('key');
     $value = static::$instance->get('key');
     verify($value)->null();
 }
Пример #2
0
 /**
  * Clear the session data from the cache.
  *
  * @param string $id The ID of the current session
  *
  * @return bool
  */
 public function destroy($id)
 {
     $this->checkId($id);
     $this->storage->clear('session.' . $id);
     return true;
 }