@@ -371,6 +371,29 @@ public function testDevices()
371371 $ this ->assertSame (count ($ response ["devices " ]), 1 );
372372 }
373373
374+ public function testGetRateLimits ()
375+ {
376+ $ response = $ this ->client ->getRateLimits ();
377+ $ this ->assertTrue (array_key_exists ("server_side " , $ response ));
378+ $ this ->assertTrue (array_key_exists ("android " , $ response ));
379+ $ this ->assertTrue (array_key_exists ("ios " , $ response ));
380+ $ this ->assertTrue (array_key_exists ("web " , $ response ));
381+ $ response = $ this ->client ->getRateLimits (true );
382+ $ this ->assertTrue (array_key_exists ("server_side " , $ response ));
383+ $ this ->assertFalse (array_key_exists ("android " , $ response ));
384+ $ this ->assertFalse (array_key_exists ("ios " , $ response ));
385+ $ this ->assertFalse (array_key_exists ("web " , $ response ));
386+ $ response = $ this ->client ->getRateLimits (true , true , false , false , array ("GetRateLimits " , "SendMessage " ));
387+ $ this ->assertTrue (array_key_exists ("server_side " , $ response ));
388+ $ this ->assertTrue (array_key_exists ("android " , $ response ));
389+ $ this ->assertFalse (array_key_exists ("ios " , $ response ));
390+ $ this ->assertFalse (array_key_exists ("web " , $ response ));
391+ $ this ->assertSame (count ($ response ["android " ]), 2 );
392+ $ this ->assertSame (count ($ response ["server_side " ]), 2 );
393+ $ this ->assertSame ($ response ["android " ]["GetRateLimits " ]["Limit " ], $ response ["android " ]["GetRateLimits " ]["Remaining " ]);
394+ $ this ->assertTrue ($ response ["server_side " ]["GetRateLimits " ]["Limit " ] > $ response ["server_side " ]["GetRateLimits " ]["Remaining " ]);
395+ }
396+
374397 public function testChannelBanUser ()
375398 {
376399 $ user = $ this ->getUser ();
0 commit comments