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:
Daniele Alessandri
2013-03-16 16:00:33 +01:00
parent 1c21fcc5b3
commit 6e2fd181f1
116 changed files with 1281 additions and 59 deletions
@@ -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
*/