mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
Implement GCRA command
This commit is contained in:
committed by
Michael Grunder
parent
c99c86349a
commit
10b77a42d6
@@ -8121,6 +8121,23 @@ class Redis_Test extends TestSuite {
|
||||
$this->assertEquals(3, count($res));
|
||||
}
|
||||
|
||||
public function testGcra() {
|
||||
if ( ! $this->haveCommand('GCRA'))
|
||||
$this->markTestSkipped();
|
||||
|
||||
$this->assertIsInt($this->redis->del('gcra'));
|
||||
|
||||
$res = $this->redis->gcra('gcra', 5, 1, 1000);
|
||||
$this->assertIsArray($res);
|
||||
$this->assertEquals(5, count($res));
|
||||
$this->assertEquals(5, count(array_filter($res, 'is_int')));
|
||||
|
||||
$res = $this->redis->gcra('gcra', 5, 1, 1000, 5);
|
||||
$this->assertIsArray($res);
|
||||
$this->assertEquals(5, count($res));
|
||||
$this->assertEquals(5, count(array_filter($res, 'is_int')));
|
||||
}
|
||||
|
||||
public function testInvalidAuthArgs() {
|
||||
$client = $this->newInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user