BedrockStreaming / RedisMock

A simple PHP Redis mock
http://tech.m6web.fr/redismock-qui-a-bouchonne-mon-redis.html
MIT License
81 stars 59 forks source link

Add SDIFF support #78

Closed tomlankhorst closed 5 years ago

tomlankhorst commented 5 years ago

SDIFF Returns the members of the set resulting from the difference between the first set and all the successive sets.

key1 = {a,b,c,d}
key2 = {c}
key3 = {a,c,e}
SDIFF key1 key2 key3 = {b,d}

Test:

$redisMock->sadd('key1', 'a', 'b', 'c', 'd');
$redisMock->sadd('key2', 'c');
$redisMock->sadd('key3', 'a', 'c', 'e');

$this->assert
    ->array($redisMock->sdiff('key1', 'key2', 'key3'))
    ->isEqualTo(['b', 'd']);
omansour commented 5 years ago

v4.3.0