mirror of
https://github.com/predis/predis.git
synced 2026-09-04 14:56:47 +00:00
Do not parse response to PERSIST into boolean value.
This commit is contained in:
@@ -24,12 +24,4 @@ class KeyPersist extends Command
|
||||
{
|
||||
return 'PERSIST';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function parseResponse($data)
|
||||
{
|
||||
return (bool) $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user