Add new command: GEORADIUS (Redis 3.2.0).

This commit is contained in:
Daniele Alessandri
2016-05-24 17:09:06 +02:00
parent b2284d015f
commit 00000fde4e
14 changed files with 405 additions and 0 deletions
@@ -139,6 +139,33 @@ class ReplicationStrategyTest extends PredisTestCase
);
}
/**
* @group disconnected
*/
public function testGeoradiusCommand()
{
$profile = Profile\Factory::getDevelopment();
$strategy = new ReplicationStrategy();
$command = $profile->createCommand('GEORADIUS', array('key:geo', 15, 37, 200, 'km'));
$this->assertTrue(
$strategy->isReadOperation($command),
'GEORADIUS is expected to be a read operation.'
);
$command = $profile->createCommand('GEORADIUS', array('key:geo', 15, 37, 200, 'km', 'store', 'key:store'));
$this->assertFalse(
$strategy->isReadOperation($command),
'GEORADIUS with STORE is expected to be a write operation.'
);
$command = $profile->createCommand('GEORADIUS', array('key:geo', 15, 37, 200, 'km', 'storedist', 'key:storedist'));
$this->assertFalse(
$strategy->isReadOperation($command),
'GEORADIUS with STOREDIST is expected to be a write operation.'
);
}
/**
* @group disconnected
* @expectedException \Predis\NotSupportedException
@@ -444,6 +471,7 @@ class ReplicationStrategyTest extends PredisTestCase
'GEOHASH' => 'read',
'GEOPOS' => 'read',
'GEODIST' => 'read',
'GEORADIUS' => 'variable',
);
if (isset($type)) {