8000 fix #942 · jrtkcoder/phpredis@8d90b02 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d90b02

Browse files
ndxbnyatsukhnenko
authored andcommitted
1 parent 6c0f70e commit 8d90b02

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

redis.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,7 @@ PHP_METHOD(Redis, setex)
837837
*/
838838
PHP_METHOD(Redis, psetex)
839839
{
840-
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd,
841-
redis_string_response);
840+
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd, redis_boolean_response);
842841
}
843842

844843
/* {{{ 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)
0