getCommand(); $command->setArguments($arguments); $this->assertSame($expected, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group connected * @requiresRedisVersion >= 2.2.0 */ public function testReturnsLengthOfList(): void { $redis = $this->getClient(); $redis->rpush('letters', 'a', 'b', 'c'); $this->assertSame(3, $redis->llen('letters')); $redis->rpush('letters', 'd', 'e', 'f'); $this->assertSame(6, $redis->llen('letters')); } /** * @group connected * @requiresRedisVersion >= 2.2.0 */ public function testReturnsZeroLengthOnNonExistingList(): void { $redis = $this->getClient(); $this->assertSame(0, $redis->llen('letters')); } /** * @group connected * @requiresRedisVersion >= 2.2.0 */ public function testThrowsExceptionOnWrongType(): void { $this->expectException('Predis\Response\ServerException'); $this->expectExceptionMessage('Operation against a key holding the wrong kind of value'); $redis = $this->getClient(); $redis->set('foo', 'bar'); $redis->llen('foo'); } }