File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1794,6 +1794,22 @@ public function testZX() {
17941794 $ this ->redis ->delete ('key2 ' );
17951795 $ this ->redis ->delete ('key3 ' );
17961796
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 ' );
17971813
17981814 // ZREMRANGEBYRANK
17991815 $ this ->redis ->zAdd ('key1 ' , 1 , 'one ' );
You can’t perform that action at this time.
0 commit comments