33namespace Intercom \Test ;
44
55use DateTimeImmutable ;
6- use Http \Adapter \Guzzle6 \Client ;
7- use Http \Client \Exception ;
8- use Intercom \IntercomClient ;
96use GuzzleHttp \Client as GuzzleClient ;
107use GuzzleHttp \Handler \MockHandler ;
11- use GuzzleHttp \Psr7 \Response ;
128use GuzzleHttp \HandlerStack ;
139use GuzzleHttp \Middleware ;
10+ use GuzzleHttp \Psr7 \Response ;
11+ use Http \Adapter \Guzzle6 \Client ;
12+ use Http \Client \Exception ;
13+ use Intercom \IntercomClient ;
1414use PHPUnit \Framework \TestCase ;
1515use stdClass ;
1616
@@ -38,7 +38,7 @@ public function testBasicClient()
3838
3939 foreach ($ container as $ transaction ) {
4040 $ basic = $ transaction ['request ' ]->getHeaders ()['Authorization ' ][0 ];
41- $ this ->assertTrue ( $ basic == "Basic dTpw " );
41+ $ this ->assertSame ( "Basic dTpw " , $ basic );
4242 }
4343 }
4444
@@ -64,7 +64,7 @@ public function testExtendedClient()
6464
6565 foreach ($ container as $ transaction ) {
6666 $ options = $ transaction ['options ' ];
67- $ this ->assertEquals ( $ options ['connect_timeout ' ], 10 );
67+ $ this ->assertSame ( 10 , $ options ['connect_timeout ' ]);
6868 }
6969 }
7070
@@ -90,9 +90,9 @@ public function testClientWithExtraHeaders()
9090
9191 foreach ($ container as $ transaction ) {
9292 $ headers = $ transaction ['request ' ]->getHeaders ();
93- $ this ->assertEquals ( $ headers ['Accept ' ][0 ], ' application/json ' );
94- $ this ->assertEquals ( $ headers ['Content-Type ' ][0 ], ' application/json ' );
95- $ this ->assertEquals ( $ headers ['Custom-Header ' ][0 ], ' value ' );
93+ $ this ->assertSame ( ' application/json ' , $ headers ['Accept ' ][0 ]);
94+ $ this ->assertSame ( ' application/json ' , $ headers ['Content-Type ' ][0 ]);
95+ $ this ->assertSame ( ' value ' , $ headers ['Custom-Header ' ][0 ]);
9696 }
9797 }
9898
@@ -163,7 +163,7 @@ public function testPaginationHelper()
163163
164164 foreach ($ container as $ transaction ) {
165165 $ host = $ transaction ['request ' ]->getUri ()->getHost ();
166- $ this ->assertTrue ( $ host == "foo.com " );
166+ $ this ->assertSame ( "foo.com " , $ host );
167167 }
168168 }
169169
@@ -198,12 +198,15 @@ public function testRateLimitDetails()
198198 ]);
199199
200200 $ rateLimitDetails = $ client ->getRateLimitDetails ();
201- $ this ->assertInternalType ( ' array ' , $ rateLimitDetails );
201+ $ this ->assertIsArray ( $ rateLimitDetails );
202202 $ this ->assertArrayHasKey ('limit ' , $ rateLimitDetails );
203203 $ this ->assertArrayHasKey ('remaining ' , $ rateLimitDetails );
204204 $ this ->assertArrayHasKey ('reset_at ' , $ rateLimitDetails );
205- $ this ->assertEquals (83 , $ rateLimitDetails ['limit ' ]);
206- $ this ->assertEquals (2 , $ rateLimitDetails ['remaining ' ]);
207- $ this ->assertEquals ((new DateTimeImmutable )->setTimestamp ($ time ), $ rateLimitDetails ['reset_at ' ]);
205+ $ this ->assertSame (83 , $ rateLimitDetails ['limit ' ]);
206+ $ this ->assertSame (2 , $ rateLimitDetails ['remaining ' ]);
207+ $ this ->assertSame (
208+ (new DateTimeImmutable )->setTimestamp ($ time )->getTimestamp (),
209+ $ rateLimitDetails ['reset_at ' ]->getTimestamp ()
210+ );
208211 }
209212}
0 commit comments