diff --git a/src/M6Web/Component/RedisMock/RedisMock.php b/src/M6Web/Component/RedisMock/RedisMock.php index 92948ba..186f35d 100644 --- a/src/M6Web/Component/RedisMock/RedisMock.php +++ b/src/M6Web/Component/RedisMock/RedisMock.php @@ -164,12 +164,17 @@ public function ttl($key) } public function expire($key, $seconds) + { + return $this->expireat($key, time() + $seconds); + } + + public function expireat($key, $timestamp) { if (!array_key_exists($key, self::$dataValues[$this->storage]) || $this->deleteOnTtlExpired($key)) { return $this->returnPipedInfo(0); } - self::$dataTtl[$this->storage][$key] = time() + $seconds; + self::$dataTtl[$this->storage][$key] = $timestamp; return $this->returnPipedInfo(1); }