@@ -5109,29 +5109,29 @@ public function genericGeoRadiusTest($cmd) {
51095109 $ this ->addCities ('{gk} ' );
51105110
51115111 /* Pre tested with redis-cli. We're just verifying proper delivery of distance and unit */
5112- if ($ cmd == 'georadius ' ) {
5113- $ this ->assertEquals ($ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 10 , 'mi ' ), [ 'Chico ' ] );
5114- $ this ->assertEquals ($ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 30 , 'mi ' ), [ 'Gridley ' ,'Chico ' ] );
5115- $ this ->assertEquals ($ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 50 , 'km ' ), [ 'Gridley ' ,'Chico ' ] );
5116- $ this ->assertEquals ($ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 50000 , 'm ' ), [ 'Gridley ' ,'Chico ' ] );
5117- $ this ->assertEquals ($ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 150000 , 'ft ' ), [ 'Gridley ' , 'Chico ' ] );
5118- $ args = [ ' georadius ' , '{gk} ' , $ lng , $ lat , 500 , 'mi ' ] ;
5112+ if ($ cmd == 'georadius ' || $ cmd == ' georadius_ro ' ) {
5113+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 10 , 'mi ' ), Array ( 'Chico ' ) );
5114+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 30 , 'mi ' ), Array ( 'Gridley ' ,'Chico ' ) );
5115+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 50 , 'km ' ), Array ( 'Gridley ' ,'Chico ' ) );
5116+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 50000 , 'm ' ), Array ( 'Gridley ' ,'Chico ' ) );
5117+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 150000 , 'ft ' ), Array ( 'Gridley ' , 'Chico ' ) );
5118+ $ args = Array ( $ cmd , '{gk} ' , $ lng , $ lat , 500 , 'mi ' ) ;
51195119
51205120 /* Test a bad COUNT argument */
5121- foreach ([ -1 , 0 , 'notanumber ' ] as $ count ) {
5122- $ this ->assertFalse (@$ this ->redis ->georadius ('{gk} ' , $ lng , $ lat , 10 , 'mi ' , [ 'count ' => $ count] ));
5121+ foreach (Array ( -1 , 0 , 'notanumber ' ) as $ count ) {
5122+ $ this ->assertFalse (@$ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 10 , 'mi ' , Array ( 'count ' => $ count) ));
51235123 }
51245124 } else {
5125- $ this ->assertEquals ($ this ->redis ->georadiusbymember ('{gk} ' , $ city , 10 , 'mi ' ), [ 'Chico ' ] );
5126- $ this ->assertEquals ($ this ->redis ->georadiusbymember ('{gk} ' , $ city , 30 , 'mi ' ), [ 'Gridley ' ,'Chico ' ] );
5127- $ this ->assertEquals ($ this ->redis ->georadiusbymember ('{gk} ' , $ city , 50 , 'km ' ), [ 'Gridley ' ,'Chico ' ] );
5128- $ this ->assertEquals ($ this ->redis ->georadiusbymember ('{gk} ' , $ city , 50000 , 'm ' ), [ 'Gridley ' ,'Chico ' ] );
5129- $ this ->assertEquals ($ this ->redis ->georadiusbymember ('{gk} ' , $ city , 150000 , 'ft ' ), [ 'Gridley ' , 'Chico ' ] );
5130- $ args = [ ' georadiusbymember ' , '{gk} ' , $ city , 500 , 'mi ' ] ;
5125+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ city , 10 , 'mi ' ), Array ( 'Chico ' ) );
5126+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ city , 30 , 'mi ' ), Array ( 'Gridley ' ,'Chico ' ) );
5127+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ city , 50 , 'km ' ), Array ( 'Gridley ' ,'Chico ' ) );
5128+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ city , 50000 , 'm ' ), Array ( 'Gridley ' ,'Chico ' ) );
5129+ $ this ->assertEquals ($ this ->redis ->$ cmd ('{gk} ' , $ city , 150000 , 'ft ' ), Array ( 'Gridley ' , 'Chico ' ) );
5130+ $ args = Array ( $ cmd , '{gk} ' , $ city , 500 , 'mi ' ) ;
51315131
51325132 /* Test a bad COUNT argument */
5133- foreach ([ -1 , 0 , 'notanumber ' ] as $ count ) {
5134- $ this ->assertFalse (@$ this ->redis ->georadiusbymember ('{gk} ' , $ city , 10 , 'mi ' , [ 'count ' => $ count] ));
5133+ foreach (Array ( -1 , 0 , 'notanumber ' ) as $ count ) {
5134+ $ this ->assertFalse (@$ this ->redis ->$ cmd ('{gk} ' , $ city , 10 , 'mi ' , Array ( 'count ' => $ count) ));
51355135 }
51365136 }
51375137
@@ -5185,7 +5185,7 @@ public function genericGeoRadiusTest($cmd) {
51855185 }
51865186
51875187 $ ret1 = $ this ->rawCommandArray ('{gk} ' , $ realargs );
5188- if ($ cmd == 'georadius ' ) {
5188+ if ($ cmd == 'georadius ' || $ cmd == ' georadius_ro ' ) {
51895189 $ ret2 = $ this ->redis ->$ cmd ('{gk} ' , $ lng , $ lat , 500 , 'mi ' , $ realopts );
51905190 } else {
51915191 $ ret2 = $ this ->redis ->$ cmd ('{gk} ' , $ city , 500 , 'mi ' , $ realopts );
@@ -5205,6 +5205,7 @@ public function testGeoRadius() {
52055205 }
52065206
52075207 $ this ->genericGeoRadiusTest ('georadius ' );
5208+ $ this ->genericGeoRadiusTest ('georadius_ro ' );
52085209 }
52095210
52105211 public function testGeoRadiusByMember () {
@@ -5213,6 +5214,7 @@ public function testGeoRadiusByMember() {
52135214 }
52145215
52155216 $ this ->genericGeoRadiusTest ('georadiusbymember ' );
5217+ $ this ->genericGeoRadiusTest ('georadiusbymember_ro ' );
52165218 }
52175219
52185220 public function testGeoPos () {
0 commit comments