Skip to content

Commit

Permalink
fix #942
Browse files Browse the repository at this point in the history
  • Loading branch information
ndxbn authored and yatsukhnenko committed Sep 9, 2016
1 parent 6c0f70e commit 8d90b02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions redis.c
Expand Up @@ -837,8 +837,7 @@ PHP_METHOD(Redis, setex)
*/
PHP_METHOD(Redis, psetex)
{
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd,
redis_string_response);
REDIS_PROCESS_KW_CMD("PSETEX", redis_key_long_val_cmd, redis_boolean_response);
}

/* {{{ proto boolean Redis::setnx(string key, string value)
Expand Down
7 changes: 7 additions & 0 deletions tests/RedisTest.php
Expand Up @@ -456,6 +456,13 @@ public function testSetEx() {
$this->assertTrue($this->redis->ttl('key') ===7);
$this->assertTrue($this->redis->get('key') === 'val');
}

public function testPSetEx() {
$this->redis->del('key');
$this->assertTrue($this->redis->psetex('key', 7 * 1000, 'val') === TRUE);
$this->assertTrue($this->redis->ttl('key') ===7);
$this->assertTrue($this->redis->get('key') === 'val');
}

public function testSetNX() {

Expand Down

0 comments on commit 8d90b02

Please sign in to comment.