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()); }
function testGetKeyArray() { $expected = array('app:foo', 'app:bar'); $this->assertEqual($expected, Redis::getKey(array('foo', 'bar'), array('format' => 'app'))); }
public function getKey($name = null) { $name = $name ?: $this->name; $namespace = $this->getNamespace(); return Redis::getKey($name, compact('namespace')); }