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:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2019-06-12 12:20:38 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2019-06-12 12:20:38 +0300
commit4852a5106a10d52dee8b570a9736aa37cf606661 (patch)
tree3c024e4a42dbe240e5b7dad4bf7b3cb38992aa31 /tests
parent1226303d515472ae2bcc9a3991ee4f4d2a808d09 (diff)
xInfo response format
Diffstat (limited to 'tests')
-rw-r--r--tests/RedisTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/RedisTest.php b/tests/RedisTest.php
index f1f960cf..d5aa89b6 100644
--- a/tests/RedisTest.php
+++ b/tests/RedisTest.php
@@ -5854,6 +5854,34 @@ class Redis_Test extends TestSuite
}
}
+ public function testXInfo()
+ {
+ if (!$this->minVersionCheck("5.0")) {
+ return $this->markTestSkipped();
+ }
+ /* Create some streams and groups */
+ $stream = 's';
+ $groups = ['g1' => 0, 'g2' => 0];
+ $this->addStreamsAndGroups([$stream], 1, $groups);
+
+ $info = $this->redis->xInfo('GROUPS', $stream);
+ $this->assertTrue(is_array($info));
+ $this->assertEquals(count($info), count($groups));
+ foreach ($info as $group) {
+ $this->assertTrue(array_key_exists('name', $group));
+ $this->assertTrue(array_key_exists($group['name'], $groups));
+ }
+
+ $info = $this->redis->xInfo('STREAM', $stream);
+ $this->assertTrue(is_array($info));
+ $this->assertTrue(array_key_exists('groups', $info));
+ $this->assertEquals($info['groups'], count($groups));
+ foreach (['first-entry', 'last-entry'] as $key) {
+ $this->assertTrue(array_key_exists($key, $info));
+ $this->assertTrue(is_array($info[$key]));
+ }
+ }
+
public function testSession_savedToRedis()
{
$this->setSessionHandler();