Do not parse response to HEXISTS into boolean value.

This commit is contained in:
Daniele Alessandri
2015-07-24 15:22:21 +02:00
parent ab20c52115
commit 231a3440f7
2 changed files with 5 additions and 13 deletions
-8
View File
@@ -24,12 +24,4 @@ class HashExists extends Command
{
return 'HEXISTS';
}
/**
* {@inheritdoc}
*/
public function parseResponse($data)
{
return (bool) $data;
}
}
+5 -5
View File
@@ -54,8 +54,8 @@ class HashExistsTest extends PredisCommandTestCase
{
$command = $this->getCommand();
$this->assertFalse($command->parseResponse(0));
$this->assertTrue($command->parseResponse(1));
$this->assertSame(0, $command->parseResponse(0));
$this->assertSame(1, $command->parseResponse(1));
}
/**
@@ -67,9 +67,9 @@ class HashExistsTest extends PredisCommandTestCase
$redis->hmset('metavars', 'foo', 'bar', 'hoge', 'piyo');
$this->assertTrue($redis->hexists('metavars', 'foo'));
$this->assertFalse($redis->hexists('metavars', 'lol'));
$this->assertFalse($redis->hexists('unknown', 'foo'));
$this->assertSame(1, $redis->hexists('metavars', 'foo'));
$this->assertSame(0, $redis->hexists('metavars', 'lol'));
$this->assertSame(0, $redis->hexists('unknown', 'foo'));
}
/**