Do not parse response to SMOVE into boolean value.

This commit is contained in:
Daniele Alessandri
2015-07-24 15:40:48 +02:00
parent e531d39f53
commit 5ce683be09
2 changed files with 4 additions and 12 deletions
-8
View File
@@ -24,12 +24,4 @@ class SetMove extends Command
{
return 'SMOVE';
}
/**
* {@inheritdoc}
*/
public function parseResponse($data)
{
return (bool) $data;
}
}
+4 -4
View File
@@ -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'));