mirror of
https://github.com/predis/predis.git
synced 2026-08-19 01:51:40 +00:00
* bugfix for srem type to accept array #779 * add test to test SREM accept members as array type #779
This commit is contained in:
@@ -111,7 +111,7 @@ use Predis\Response\Status;
|
||||
* @method int smove(string $source, string $destination, string $member)
|
||||
* @method string|array|null spop(string $key, int $count = null)
|
||||
* @method string|null srandmember(string $key, int $count = null)
|
||||
* @method int srem(string $key, string $member)
|
||||
* @method int srem(string $key, array|string $member)
|
||||
* @method array sscan(string $key, int $cursor, array $options = null)
|
||||
* @method string[] sunion(array|string $keys)
|
||||
* @method int sunionstore(string $destination, array|string $keys)
|
||||
|
||||
@@ -101,6 +101,22 @@ class SREM_Test extends PredisCommandTestCase
|
||||
$this->assertSame(0, $redis->srem('digits', 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
* @requiresRedisVersion >= 2.4.0
|
||||
*/
|
||||
public function testRemovesMembersInArrayTypeFromSetVariadic(): void
|
||||
{
|
||||
$redis = $this->getClient();
|
||||
|
||||
$redis->sadd('letters', 'a', 'b', 'c', 'd');
|
||||
|
||||
$this->assertSame(2, $redis->srem('letters', ['b', 'd', 'z']));
|
||||
$this->assertSameValues(array('a', 'c'), $redis->smembers('letters'));
|
||||
|
||||
$this->assertSame(0, $redis->srem('digits', [1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user