Do not parse response to PERSIST into boolean value.

This commit is contained in:
Daniele Alessandri
2015-07-24 15:36:42 +02:00
parent e75b69f6fd
commit 44e92d8a2f
2 changed files with 5 additions and 13 deletions
-8
View File
@@ -24,12 +24,4 @@ class KeyPersist extends Command
{
return 'PERSIST';
}
/**
* {@inheritdoc}
*/
public function parseResponse($data)
{
return (bool) $data;
}
}
+5 -5
View File
@@ -54,8 +54,8 @@ class KeyPersistTest 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));
}
/**
@@ -68,7 +68,7 @@ class KeyPersistTest extends PredisCommandTestCase
$redis->set('foo', 'bar');
$redis->expire('foo', 10);
$this->assertTrue($redis->persist('foo'));
$this->assertSame(1, $redis->persist('foo'));
$this->assertSame(-1, $redis->ttl('foo'));
}
@@ -81,7 +81,7 @@ class KeyPersistTest extends PredisCommandTestCase
$redis->set('foo', 'bar');
$this->assertFalse($redis->persist('foo'));
$this->assertSame(0, $redis->persist('foo'));
}
/**
@@ -91,6 +91,6 @@ class KeyPersistTest extends PredisCommandTestCase
{
$redis = $this->getClient();
$this->assertFalse($redis->persist('foo'));
$this->assertSame(0, $redis->persist('foo'));
}
}