예제 #1
0
 public function testCacheKey()
 {
     $ck = new CacheKey('base', 'id', 'sub');
     $this->assertEquals('base', $ck->getBase());
     $this->assertEquals('id', $ck->getId());
     $this->assertEquals('sub', $ck->getSub());
     $ck = new CacheKey(null, null);
     $ck->setBase('base')->setId('id')->setSub('sub');
     $this->assertEquals('base', $ck->getBase());
     $this->assertEquals('id', $ck->getId());
     $this->assertEquals('sub', $ck->getSub());
     $this->assertNotNull($ck->getHash());
 }
예제 #2
0
 /**
  * Converts cachekey to a string for the data group.
  *
  * @param CacheKey $k
  * @return string
  */
 private function getGroupString(CacheKey $k)
 {
     return md5(strtr($this->namespace . $k->getBase() . $k->getId(), ' ', '_'));
 }
예제 #3
0
 /**
  * @codeCoverageIgnore
  */
 protected function hashKey(CacheKey $k)
 {
     return $k->getBase() . $k->getId() . serialize($k->getSub());
 }