Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afcd844

Browse files
committed
fix #942
1 parent 8eae7ec commit afcd844

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

redis.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,7 @@ PHP_METHOD(Redis, setex)
855855
*/
856856
PHP_METHOD(Redis, psetex)
857857
{
858-
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd,
859-
redis_string_response);
858+
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd, redis_boolean_response);
860859
}
861860

862861
/* {{{ proto boolean Redis::setnx(string key, string value)

tests/RedisTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,13 @@ public function testSetEx() {
456456
$this->assertTrue($this->redis->ttl('key') ===7);
457457
$this->assertTrue($this->redis->get('key') === 'val');
458458
}
459+
460+
public function testPSetEx() {
461+
$this->redis->del('key');
462+
$this->assertTrue($this->redis->psetex('key', 7 * 1000, 'val') === TRUE);
463+
$this->assertTrue($this->redis->ttl('key') ===7);
464+
$this->assertTrue($this->redis->get('key') === 'val');
465+
}
459466

460467
public function testSetNX() {
461468

0 commit comments

Comments
 (0)