mirror of
https://github.com/predis/predis.git
synced 2026-08-22 11:10:59 +00:00
Make sure key prefixing is skipped when command has no arguments.
Actually this was already the case for certain commands, but some of them was left unguarded for such cases. This commit also fixes #109. The behaviour of silently skipping key prefixing when a command has no arguments may change in the future so we added explicit tests as guards for future changes. Predis\Command\Processor\KeyPrefixProcessor will continue to skip key prefixing on empty arguments, regardless.
This commit is contained in:
@@ -71,6 +71,17 @@ class StringPreciseSetExpireTest extends CommandTestCase
|
||||
$this->assertSame($expected, $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testPrefixKeysIgnoredOnEmptyArguments()
|
||||
{
|
||||
$command = $this->getCommand();
|
||||
$command->prefixKeys('prefix:');
|
||||
|
||||
$this->assertSame(array(), $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group connected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user