Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a968d9e

Browse files
committed
SCRIPT / EVAL / TIME are new in 2.6.0
1 parent 36f5f76 commit a968d9e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/TestRedis.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,6 +2986,11 @@ private function checkSerializer($mode) {
29862986
}
29872987

29882988
public function testDumpRestore() {
2989+
2990+
if (version_compare($this->version, "2.5.0", "lt")) {
2991+
return;
2992+
}
2993+
29892994
$this->redis->del('foo');
29902995
$this->redis->del('bar');
29912996

@@ -3046,6 +3051,11 @@ private function array_diff_recursive($aArray1, $aArray2) {
30463051
}
30473052

30483053
public function testScript() {
3054+
3055+
if (version_compare($this->version, "2.5.0", "lt")) {
3056+
return;
3057+
}
3058+
30493059
// Flush any scripts we have
30503060
$this->assertTrue($this->redis->script('flush'));
30513061

@@ -3073,6 +3083,11 @@ public function testScript() {
30733083
}
30743084

30753085
public function testEval() {
3086+
3087+
if (version_compare($this->version, "2.5.0", "lt")) {
3088+
return;
3089+
}
3090+
30763091
// Basic single line response tests
30773092
$this->assertTrue(1 == $this->redis->eval('return 1'));
30783093
$this->assertTrue(1.55 == $this->redis->eval("return '1.55'"));
@@ -3186,6 +3201,11 @@ public function testEval() {
31863201
}
31873202

31883203
public function testEvalSHA() {
3204+
3205+
if (version_compare($this->version, "2.5.0", "lt")) {
3206+
return;
3207+
}
3208+
31893209
// Flush any loaded scripts
31903210
$this->redis->script('flush');
31913211

@@ -3279,6 +3299,11 @@ public function testReconnectSelect() {
32793299
}
32803300

32813301
public function testTime() {
3302+
3303+
if (version_compare($this->version, "2.5.0", "lt")) {
3304+
return;
3305+
}
3306+
32823307
$time_arr = $this->redis->time();
32833308
$this->assertTrue(is_array($time_arr) && count($time_arr) == 2 &&
32843309
strval(intval($time_arr[0])) === strval($time_arr[0]) &&

0 commit comments

Comments
 (0)