getCommand(); $command->setArguments($arguments); $this->assertSame($expected, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(0, $this->getCommand()->parseResponse(0)); $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group connected */ public function testRenamesKeys(): void { $redis = $this->getClient(); $redis->set('foo', 'bar'); $this->assertSame(1, $redis->renamenx('foo', 'foofoo')); $this->assertSame(0, $redis->exists('foo')); $this->assertSame(1, $redis->exists('foofoo')); } /** * @group connected */ public function testThrowsExceptionWhenRenamingNonExistingKeys(): void { $this->expectException('Predis\Response\ServerException'); $this->expectExceptionMessage('ERR no such key'); $redis = $this->getClient(); $this->assertSame(0, $redis->renamenx('foo', 'foobar')); } }