File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -6064,6 +6064,21 @@ public function testXInfo()
6064
6064
}
6065
6065
}
6066
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
+
6067
6082
public function testInvalidAuthArgs () {
6068
6083
$ obj_new = $ this ->newInstance ();
6069
6084
You can’t perform that action at this time.
0 commit comments