mirror of
https://github.com/predis/predis.git
synced 2026-09-24 01:02:19 +00:00
Add normalizeVariadic to RPUSHX and LPUSHX commands (#1633)
* Add normalizeVariadic to RPUSHX and LPUSHX commands
RPUSHX and LPUSHX commands were missing the setArguments method
with normalizeVariadic call, unlike their RPUSH and LPUSH counterparts.
This caused errors when passing values as a single array argument
(e.g. $client->rpushx('key', ['val1', 'val2'])).
Fixes #1504
* Update CHANGELOG.md with RPUSHX/LPUSHX variadic fix (#1633)
* Fix variadic arguments normalization for [L|R]PUSHX
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
This commit is contained in:
@@ -50,6 +50,20 @@ class LPUSHX_Test extends PredisCommandTestCase
|
||||
$this->assertSame($expected, $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
public function testFilterArgumentsValuesAsSingleArray(): void
|
||||
{
|
||||
$arguments = ['key', ['value1', 'value2', 'value3']];
|
||||
$expected = ['key', 'value1', 'value2', 'value3'];
|
||||
|
||||
$command = $this->getCommand();
|
||||
$command->setArguments($arguments);
|
||||
|
||||
$this->assertSame($expected, $command->getArguments());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group disconnected
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user