diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-10-02 02:41:52 +0300 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-10-02 11:33:50 +0300 |
commit | f5b2a09b3402dda28dc5b23bd9fdce32284ab550 (patch) | |
tree | ddc5cf3f5e9cd56ad16a44e5761e334e600ffb99 /tests | |
parent | c0e839f6ac45d51adbb109b246c9b3565c3b61e1 (diff) |
EXPIRETIME and PEXPIRETIME
Diffstat (limited to 'tests')
-rw-r--r-- | tests/RedisTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/RedisTest.php b/tests/RedisTest.php index 2e4402f3..4d022a6e 100644 --- a/tests/RedisTest.php +++ b/tests/RedisTest.php @@ -605,6 +605,21 @@ class Redis_Test extends TestSuite $this->assertTrue($success); } + public function testExpiretime() { + if(version_compare($this->version, "7.0.0") < 0) { + $this->markTestSkipped(); + } + + $now = time(); + + $this->assertTrue($this->redis->set('key1', 'value')); + $this->assertTrue($this->redis->expireat('key1', $now + 10)); + $this->assertEquals($now + 10, $this->redis->expiretime('key1')); + $this->assertEquals(1000 * ($now + 10), $this->redis->pexpiretime('key1')); + + $this->redis->del('key1'); + } + public function testSetEx() { $this->redis->del('key'); |