File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1794,6 +1794,22 @@ public function testZX() {
1794
1794
$ this ->redis ->delete ('key2 ' );
1795
1795
$ this ->redis ->delete ('key3 ' );
1796
1796
1797
+ $ this ->redis ->zadd ('key1 ' , 2000.1 , 'one ' );
1798
+ $ this ->redis ->zadd ('key1 ' , 3000.1 , 'two ' );
1799
+ $ this ->redis ->zadd ('key1 ' , 4000.1 , 'three ' );
1800
+
1801
+ $ ret = $ this ->redis ->zRange ('key1 ' , 0 , -1 , TRUE );
1802
+ $ this ->assertTrue (count ($ ret ) === 3 );
1803
+ $ retValues = array_keys ($ ret );
1804
+
1805
+ $ this ->assertTrue (array ('one ' , 'two ' , 'three ' ) === $ retValues );
1806
+
1807
+ // + 0 converts from string to float OR integer
1808
+ $ this ->assertTrue (is_float ($ ret ['one ' ] + 0 ));
1809
+ $ this ->assertTrue (is_float ($ ret ['two ' ] + 0 ));
1810
+ $ this ->assertTrue (is_float ($ ret ['three ' ] + 0 ));
1811
+
1812
+ $ this ->redis ->delete ('key1 ' );
1797
1813
1798
1814
// ZREMRANGEBYRANK
1799
1815
$ this ->redis ->zAdd ('key1 ' , 1 , 'one ' );
You can’t perform that action at this time.
0 commit comments