/** * @group redis-lists */ public function testListRightPopLeftPush() { $this->assertNull($this->client->rpoplpush('foo', 'bar')); $this->assertEquals(array(), $this->client->lrange('bar', 0, -1)); $this->client->rpush('foo', 'A', 'B'); $this->client->rpush('bar', 'C', 'D'); $this->assertEquals('B', $this->client->rpoplpush('foo', 'bar')); $this->assertEquals(array('A'), $this->client->lrange('foo', 0, -1)); $this->assertEquals(array('B', 'C', 'D'), $this->client->lrange('bar', 0, -1)); }
public function countEventsFor(StreamName $streamName, AggregateIdInterface $aggregateId) { return count($this->redis->lrange($this->getNamespaceKey($streamName, $aggregateId), 0, -1)); }