예제 #1
0
 function testConstructLeaderboardClassWithName()
 {
     $leaderboard = new Leaderboard('leaderboard');
     $this->assertEqual('leaderboard', $leaderboard->getName());
     $namespace = Leaderboard::$namespace;
     $expected = Redis::getKey('leaderboard', compact('namespace'));
     $this->assertEqual($expected, $leaderboard->getKey());
 }
예제 #2
0
 function testGetKeyArray()
 {
     $expected = array('app:foo', 'app:bar');
     $this->assertEqual($expected, Redis::getKey(array('foo', 'bar'), array('format' => 'app')));
 }
예제 #3
0
 public function getKey($name = null)
 {
     $name = $name ?: $this->name;
     $namespace = $this->getNamespace();
     return Redis::getKey($name, compact('namespace'));
 }