mirror of
https://github.com/predis/predis.git
synced 2026-09-09 09:56:55 +00:00
Do not parse response to SMOVE into boolean value.
This commit is contained in:
@@ -24,12 +24,4 @@ class SetMove extends Command
|
||||
{
|
||||
return 'SMOVE';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function parseResponse($data)
|
||||
{
|
||||
return (bool) $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ class SetMoveTest extends PredisCommandTestCase
|
||||
{
|
||||
$command = $this->getCommand();
|
||||
|
||||
$this->assertTrue($command->parseResponse(1));
|
||||
$this->assertFalse($command->parseResponse(0));
|
||||
$this->assertSame(0, $command->parseResponse(0));
|
||||
$this->assertSame(1, $command->parseResponse(1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,8 +67,8 @@ class SetMoveTest extends PredisCommandTestCase
|
||||
|
||||
$redis->sadd('letters:source', 'a', 'b', 'c');
|
||||
|
||||
$this->assertTrue($redis->smove('letters:source', 'letters:destination', 'b'));
|
||||
$this->assertFalse($redis->smove('letters:source', 'letters:destination', 'z'));
|
||||
$this->assertSame(1, $redis->smove('letters:source', 'letters:destination', 'b'));
|
||||
$this->assertSame(0, $redis->smove('letters:source', 'letters:destination', 'z'));
|
||||
|
||||
$this->assertSameValues(array('a', 'c'), $redis->smembers('letters:source'));
|
||||
$this->assertSameValues(array('b'), $redis->smembers('letters:destination'));
|
||||
|
||||
Reference in New Issue
Block a user