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:
authorRemi Collet <remi@remirepo.net>2019-06-26 17:26:08 +0300
committerRemi Collet <remi@remirepo.net>2019-07-09 11:00:40 +0300
commit2abc61da318e2b8287fe0647f84a2b028ca913b0 (patch)
tree91e3a880ed26a618b47a9ead7bc6d64ca9ba17a1 /tests
parent52764748121bf0c6980b53f1212fa5a25e98fa5b (diff)
Add support for Zstd compression
Diffstat (limited to 'tests')
-rw-r--r--tests/RedisTest.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/RedisTest.php b/tests/RedisTest.php
index 6e361436..027291a2 100644
--- a/tests/RedisTest.php
+++ b/tests/RedisTest.php
@@ -4485,14 +4485,26 @@ class Redis_Test extends TestSuite
if (!defined('Redis::COMPRESSION_LZF')) {
$this->markTestSkipped();
}
- $this->checkCompression(Redis::COMPRESSION_LZF);
+ $this->checkCompression(Redis::COMPRESSION_LZF, 0);
}
- private function checkCompression($mode)
+ public function testCompressionZSTD()
+ {
+ if (!defined('Redis::COMPRESSION_ZSTD')) {
+ $this->markTestSkipped();
+ }
+ $this->checkCompression(Redis::COMPRESSION_ZSTD, 0);
+ $this->checkCompression(Redis::COMPRESSION_ZSTD, 9);
+ }
+
+ private function checkCompression($mode, $level)
{
$this->assertTrue($this->redis->setOption(Redis::OPT_COMPRESSION, $mode) === TRUE); // set ok
$this->assertTrue($this->redis->getOption(Redis::OPT_COMPRESSION) === $mode); // get ok
+ $this->assertTrue($this->redis->setOption(Redis::OPT_COMPRESSION_LEVEL, $level) === TRUE);
+ $this->assertTrue($this->redis->getOption(Redis::OPT_COMPRESSION_LEVEL) === $level);
+
$val = 'xxxxxxxxxx';
$this->redis->set('key', $val);
$this->assertEquals($val, $this->redis->get('key'));