[tests] Test count argument for SPOP in Redis 3.2.

This commit is contained in:
Daniele Alessandri
2016-05-23 15:53:30 +02:00
parent 763acd232d
commit da009e59dd
+18 -2
View File
@@ -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