Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psetex method returns '+OK' on success, not true #942

Closed
ndxbn opened this issue Sep 9, 2016 · 6 comments
Closed

psetex method returns '+OK' on success, not true #942

ndxbn opened this issue Sep 9, 2016 · 6 comments

Comments

@ndxbn
Copy link
Contributor

ndxbn commented Sep 9, 2016

$redis = new Redis();
$redis->conenct();
$redis->psetex('a', 1, 1000); // returns "+OK", not true

In setter methods (ex. set(), setex()...) will returns true, but only psetex method will returns '+OK' string on success.
I think this is bug.

The bug may due to this line .
It should be "redis_boolean_response".

@yatsukhnenko
Copy link
Member

@Sitri, nice catch! Could you create a pull request?

@ndxbn
Copy link
Contributor Author

ndxbn commented Sep 9, 2016

@yatsukhnenko yes, I'm working now.
Which branch should I work for PR? Is development ?

@yatsukhnenko
Copy link
Member

@Sitri, yep, you can use develop brunch. Also, could you add test for this? Just copy/paste it from testSetEx? :)

@ndxbn
Copy link
Contributor Author

ndxbn commented Sep 9, 2016

@yatsukhnenko ok, thx.
I added this test (almost as testSetEx)

    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');
    }

or is this not enaugh?

@yatsukhnenko
Copy link
Member

👍

@ndxbn
Copy link
Contributor Author

ndxbn commented Sep 9, 2016

I created #944, please review to this

yatsukhnenko added a commit that referenced this issue Sep 9, 2016
yatsukhnenko pushed a commit that referenced this issue Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants