Esempio n. 1
0
 /**
  * Test getting the type of a key
  */
 public function testType()
 {
     $this->redis->del('testType');
     $this->redis->del('testTypeString');
     $this->redis->del('testTypeList');
     $this->redis->del('testTypeSet');
     $this->redis->del('testTypeZset');
     $this->redis->del('testTypeHash');
     $this->assertEquals('none', $this->redis->type('testType'));
     $this->redis->set('testTypeString', 'someValue');
     $this->assertEquals('string', $this->redis->type('testTypeString'));
     $this->redis->lpush('testTypeList', 'someValue');
     $this->assertEquals('list', $this->redis->type('testTypeList'));
     $this->redis->sadd('testTypeSet', 'someValue');
     $this->assertEquals('set', $this->redis->type('testTypeSet'));
     $this->redis->zAdd('testTypeZset', 1, 'one');
     $this->assertEquals('zset', $this->redis->type("testTypeZset"));
     $this->redis->hSet('testTypeHash', 'field', 'value');
     $this->assertEquals('hash', $this->redis->type('testTypeHash'));
 }