@@ -266,4 +266,37 @@ public function test_georadiusbymember() {
266266 }
267267 }
268268
269+
270+ /**
271+ * @see GeoCommandsTrait::geodel
272+ */
273+ public function test_geodel () {
274+ $ Redis = static ::$ Redis ;
275+
276+ $ this ->assertSame (3 , $ Redis ->geoadd ('Sicily ' , [
277+ 'Agrigento ' => ['13.583333 ' , '37.316667 ' ],
278+ 'Palermo ' => ['13.361389 ' , '38.115556 ' ],
279+ 'Catania ' => ['15.087269 ' , '37.502669 ' ]
280+ ]));
281+
282+ $ this ->assertSame (['Agrigento ' , 'Palermo ' , 'Catania ' ], $ Redis ->georadiusbymember ('Sicily ' , 'Agrigento ' , 300 , 'km ' , 0 , 0 , 0 , 0 , true ));
283+
284+ $ this ->assertSame (1 , $ Redis ->geodel ('Sicily ' , 'Palermo ' ));
285+ $ this ->assertSame (['Agrigento ' , 'Catania ' ], $ Redis ->georadiusbymember ('Sicily ' , 'Agrigento ' , 300 , 'km ' , 0 , 0 , 0 , 0 , true ));
286+
287+ $ this ->assertSame (0 , $ Redis ->geodel ('Sicily ' , 'Palermo ' ));
288+ $ this ->assertSame (['Agrigento ' , 'Catania ' ], $ Redis ->georadiusbymember ('Sicily ' , 'Agrigento ' , 300 , 'km ' , 0 , 0 , 0 , 0 , true ));
289+
290+ $ this ->assertSame (1 , $ Redis ->geodel ('Sicily ' , ['Catania ' , 'Catania ' , 'Palermo ' ]));
291+ $ this ->assertSame (['Agrigento ' ], $ Redis ->georadiusbymember ('Sicily ' , 'Agrigento ' , 300 , 'km ' , 0 , 0 , 0 , 0 , true ));
292+
293+ $ Redis ->set ('foo ' , 'bar ' );
294+ try {
295+ $ Redis ->geodel ('foo ' , 'Agrigento ' );
296+ $ this ->assertFalse ('Expect Exception ' );
297+ } catch (\Exception $ Ex ) {
298+ $ this ->assertInstanceOf (ErrorResponseException::class, $ Ex );
299+ }
300+ }
301+
269302}
0 commit comments