Skip to content

Commit 88a3173

Browse files
committed
Update tests to check accordingly
1 parent f74d1e6 commit 88a3173

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/ClientTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ public function test_it_deals_with_unexpected_error()
671671
public function test_it_deals_with_forbidden_error()
672672
{
673673
$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));
675676
$client = new Client($http, $factory, $factory, ["apiKey" => "key"]);
676677

677678
$this->assertEquals(
@@ -720,12 +721,12 @@ public function test_it_adds_rate_limit_information()
720721
public function test_it_knows_when_rate_limited()
721722
{
722723
$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"}}';
724725
$http = new HttpClientFixed(new Response(429, [], $json));
725726
$client = new Client($http, $factory, $factory, ["apiKey" => "key"]);
726727

727728
$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),
729730
$client->addEvent(Event::forUser("login", UserIdentified::byUserId("1")))
730731
);
731732
}

0 commit comments

Comments
 (0)