From ca9cc1dd109ed589e3eaa6c03af135da1fad0fbb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 23 Mar 2023 10:23:42 +0100 Subject: add patch for test suite with redis 7.2 from https://github.com/phpredis/phpredis/pull/2335 --- redis-tests.patch | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 redis-tests.patch (limited to 'redis-tests.patch') diff --git a/redis-tests.patch b/redis-tests.patch new file mode 100644 index 0000000..e76bb78 --- /dev/null +++ b/redis-tests.patch @@ -0,0 +1,53 @@ +Adapted for version 5.3.7 from + +From 67f2b31d5dbb7ba0ad423d07a1256f14b6f019c5 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 23 Mar 2023 10:05:04 +0100 +Subject: [PATCH] fix testObject for redis 7.2 + +--- + tests/RedisTest.php | 8 +++++--- + tests/TestSuite.php | 6 +++--- + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff -up ./tests/RedisTest.php.pr2335 ./tests/RedisTest.php +--- ./tests/RedisTest.php.pr2335 2023-03-23 10:17:56.611597097 +0100 ++++ ./tests/RedisTest.php 2023-03-23 10:19:48.911307411 +0100 +@@ -2744,14 +2744,15 @@ class Redis_Test extends TestSuite + /* Newer versions of redis are going to encode lists as 'quicklists', + * so 'quicklist' or 'ziplist' is valid here */ + $str_encoding = $this->redis->object('encoding', 'key'); +- $this->assertTrue($str_encoding === "ziplist" || $str_encoding === 'quicklist'); ++ $this->assertTrue($str_encoding === "ziplist" || $str_encoding === 'quicklist' || $str_encoding === 'listpack', $str_encoding); + + $this->assertTrue($this->redis->object('refcount', 'key') === 1); + $this->assertTrue($this->redis->object('idletime', 'key') === 0); + + $this->redis->del('key'); + $this->redis->sadd('key', 'value'); +- $this->assertTrue($this->redis->object('encoding', 'key') === "hashtable"); ++ $str_encoding = $this->redis->object('encoding', 'key'); ++ $this->assertTrue($str_encoding === "hashtable" || $str_encoding === 'listpack', $str_encoding); + $this->assertTrue($this->redis->object('refcount', 'key') === 1); + $this->assertTrue($this->redis->object('idletime', 'key') === 0); + +diff -up ./tests/TestSuite.php.pr2335 ./tests/TestSuite.php +--- ./tests/TestSuite.php.pr2335 2022-02-15 19:25:22.000000000 +0100 ++++ ./tests/TestSuite.php 2023-03-23 10:17:56.611597097 +0100 +@@ -99,13 +99,13 @@ class TestSuite + return false; + } + +- protected function assertTrue($bool) { ++ protected function assertTrue($bool, $msg='') { + if($bool) + return true; + + $bt = debug_backtrace(false); +- self::$errors []= sprintf("Assertion failed: %s:%d (%s)\n", +- $bt[0]["file"], $bt[0]["line"], $bt[1]["function"]); ++ self::$errors []= sprintf("Assertion failed: %s:%d (%s) %s\n", ++ $bt[0]["file"], $bt[0]["line"], $bt[1]["function"], $msg); + + return false; + } -- cgit