@@ -671,7 +671,8 @@ public function test_it_deals_with_unexpected_error()
671
671
public function test_it_deals_with_forbidden_error ()
672
672
{
673
673
$ factory = new Psr17Factory ();
674
- $ http = new HttpClientFixed (new Response (403 , [], null ));
674
+ $ json = '{"message":"the api key is disabled","meta":{"status":403,"requestId":"01ETG3HQ4JY4HNNZ84FBJM3CSC"}} ' ;
675
+ $ http = new HttpClientFixed (new Response (403 , [], $ json ));
675
676
$ client = new Client ($ http , $ factory , $ factory , ["apiKey " => "key " ]);
676
677
677
678
$ this ->assertEquals (
@@ -720,12 +721,12 @@ public function test_it_adds_rate_limit_information()
720
721
public function test_it_knows_when_rate_limited ()
721
722
{
722
723
$ factory = new Psr17Factory ();
723
- $ json = '{"message":"The data is correctly stored. ","meta":{"status":201,"requestId":"01ETG3HQ4JY4HNNZ84FBJM3CSC"}} ' ;
724
+ $ json = '{"message":"you have sent too much requests ","meta":{"status":201,"requestId":"01ETG3HQ4JY4HNNZ84FBJM3CSC"}} ' ;
724
725
$ http = new HttpClientFixed (new Response (429 , [], $ json ));
725
726
$ client = new Client ($ http , $ factory , $ factory , ["apiKey " => "key " ]);
726
727
727
728
$ this ->assertEquals (
728
- new CallResult (false , true , 0 , 0 , ["rate limited " ], null ),
729
+ new CallResult (false , true , 0 , 0 , ["you have sent too much requests " ], null ),
729
730
$ client ->addEvent (Event::forUser ("login " , UserIdentified::byUserId ("1 " )))
730
731
);
731
732
}
0 commit comments