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