getCommand(); $command->setArguments([]); $this->assertSame([], $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame('OK', $this->getCommand()->parseResponse('OK')); } /** * @group connected * @requiresRedisVersion >= 2.0.0 */ public function testAbortsTransactionAndRestoresNormalFlow(): void { $redis = $this->getClient(); $redis->multi(); $this->assertEquals('QUEUED', $redis->set('foo', 'bar')); $this->assertEquals('OK', $redis->discard()); $this->assertSame(0, $redis->exists('foo')); } /** * @group connected * @requiresRedisVersion >= 2.0.0 */ public function testThrowsExceptionWhenCallingOutsideTransaction(): void { $this->expectException('Predis\Response\ServerException'); $this->expectExceptionMessage('ERR DISCARD without MULTI'); $redis = $this->getClient(); $redis->discard(); } }