mirror of
https://github.com/predis/predis.git
synced 2026-10-09 05:16:32 +00:00
Prevent failures serializing commands with "holes" in arguments array.
This could be triggered when passing an array with "holes" to variadic commands. Connection classes based on the protocol serialized exposed by phpiredis were not affected by this bug. Fixes #316.
This commit is contained in:
@@ -241,6 +241,19 @@ abstract class PredisConnectionTestCase extends PredisTestCase
|
||||
$this->assertEquals('PONG', $connection->executeCommand($cmdPing));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testExecutesCommandWithHolesInArguments()
|
||||
{
|
||||
$profile = $this->getCurrentProfile();
|
||||
$cmdDel = $profile->createCommand('mget', array(0 => 'key:0', 2 => 'key:2'));
|
||||
|
||||
$connection = $this->createConnection();
|
||||
|
||||
$this->assertSame(array(null, null), $connection->executeCommand($cmdDel));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user