mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
[tests] Test count argument for SPOP in Redis 3.2.
This commit is contained in:
@@ -38,8 +38,8 @@ class SetPopTest extends PredisCommandTestCase
|
||||
*/
|
||||
public function testFilterArguments()
|
||||
{
|
||||
$arguments = array('key');
|
||||
$expected = array('key');
|
||||
$arguments = array('key', 2);
|
||||
$expected = array('key', 2);
|
||||
|
||||
$command = $this->getCommand();
|
||||
$command->setArguments($arguments);
|
||||
@@ -70,6 +70,22 @@ class SetPopTest extends PredisCommandTestCase
|
||||
$this->assertNull($redis->spop('letters'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @requiresRedisVersion >= 3.2.0
|
||||
*/
|
||||
public function testPopsMoreRandomMembersFromSet()
|
||||
{
|
||||
$redis = $this->getClient();
|
||||
|
||||
$redis->sadd('letters', 'a', 'b', 'c');
|
||||
|
||||
$this->assertSameValues(array('a', 'b', 'c'), $redis->spop('letters', 3));
|
||||
$this->assertEmpty($redis->spop('letters', 3));
|
||||
|
||||
$this->assertNull($redis->spop('letters'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @expectedException \Predis\Response\ServerException
|
||||
|
||||
Reference in New Issue
Block a user