Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2022-10-02 02:41:52 +0300
committerMichael Grunder <michael.grunder@gmail.com>2022-10-02 11:33:50 +0300
commitf5b2a09b3402dda28dc5b23bd9fdce32284ab550 (patch)
treeddc5cf3f5e9cd56ad16a44e5761e334e600ffb99 /tests
parentc0e839f6ac45d51adbb109b246c9b3565c3b61e1 (diff)
EXPIRETIME and PEXPIRETIME
Diffstat (limited to 'tests')
-rw-r--r--tests/RedisTest.php15
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');