We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5719c9f commit 566fdeeCopy full SHA for 566fdee
tests/RedisTest.php
@@ -6064,6 +6064,21 @@ public function testXInfo()
6064
}
6065
6066
6067
+ /* Regression test for issue-1831 (XINFO STREAM on an empty stream) */
6068
+ public function testXInfoEmptyStream() {
6069
+ /* Configure an empty stream */
6070
+ $this->redis->del('s');
6071
+ $this->redis->xAdd('s', '*', ['foo' => 'bar']);
6072
+ $this->redis->xTrim('s', 0);
6073
+
6074
+ $arr_info = $this->redis->xInfo('STREAM', 's');
6075
6076
+ $this->assertTrue(is_array($arr_info));
6077
+ $this->assertEquals(0, $arr_info['length']);
6078
+ $this->assertEquals(NULL, $arr_info['first-entry']);
6079
+ $this->assertEquals(NULL, $arr_info['last-entry']);
6080
+ }
6081
6082
public function testInvalidAuthArgs() {
6083
$obj_new = $this->newInstance();
6084
0 commit comments