@@ -11,11 +11,9 @@ class IntercomClientTest extends PHPUnit_Framework_TestCase
1111{
1212 public function testBasicClient ()
1313 {
14- $ mock = new MockHandler (
15- [
14+ $ mock = new MockHandler ([
1615 new Response (200 , ['X-Foo ' => 'Bar ' ], "{ \"foo \": \"bar \"} " )
17- ]
18- );
16+ ]);
1917
2018 $ container = [];
2119 $ history = Middleware::history ($ container );
@@ -27,11 +25,9 @@ public function testBasicClient()
2725 $ client = new IntercomClient ('u ' , 'p ' );
2826 $ client ->setClient ($ http_client );
2927
30- $ client ->users ->create (
31- [
28+ $ client ->users ->create ([
322933- ]
34- );
30+ ]);
3531
3632 foreach ($ container as $ transaction ) {
3733 $ basic = $ transaction ['request ' ]->getHeaders ()['Authorization ' ][0 ];
@@ -41,11 +37,9 @@ public function testBasicClient()
4137
4238 public function testExtendedClient ()
4339 {
44- $ mock = new MockHandler (
45- [
40+ $ mock = new MockHandler ([
4641 new Response (200 , ['X-Foo ' => 'Bar ' ], "{ \"foo \": \"bar \"} " )
47- ]
48- );
42+ ]);
4943
5044 $ container = [];
5145 $ history = Middleware::history ($ container );
@@ -57,11 +51,9 @@ public function testExtendedClient()
5751 $ client = new IntercomClient ('u ' , 'p ' , ['connect_timeout ' => 10 ]);
5852 $ client ->setClient ($ http_client );
5953
60- $ client ->users ->create (
61- [
54+ $ client ->users ->create ([
625563- ]
64- );
56+ ]);
6557
6658 foreach ($ container as $ transaction ) {
6759 $ basic = $ client ->getGuzzleRequestOptions ()['connect_timeout ' ];
@@ -72,11 +64,9 @@ public function testExtendedClient()
7264
7365 public function testPaginationHelper ()
7466 {
75- $ mock = new MockHandler (
76- [
67+ $ mock = new MockHandler ([
7768 new Response (200 , ['X-Foo ' => 'Bar ' ], "{ \"foo \": \"bar \"} " )
78- ]
79- );
69+ ]);
8070
8171 $ container = [];
8272 $ history = Middleware::history ($ container );
@@ -103,11 +93,17 @@ public function testRateLimitDetails()
10393 {
10494 date_default_timezone_set ('UTC ' );
10595 $ time = time () + 7 ;
106- $ mock = new MockHandler (
107- [
108- new Response (200 , ['X-RateLimit-Limit ' => '83 ' , 'X-RateLimit-Remaining ' => '2 ' , 'X-RateLimit-Reset ' => $ time ], "{ \"foo \": \"bar \"} " )
109- ]
110- );
96+ $ mock = new MockHandler ([
97+ new Response (
98+ 200 ,
99+ [
100+ 'X-RateLimit-Limit ' => '83 ' ,
101+ 'X-RateLimit-Remaining ' => '2 ' ,
102+ 'X-RateLimit-Reset ' => $ time
103+ ],
104+ "{ \"foo \": \"bar \"} "
105+ )
106+ ]);
111107
112108 $ container = [];
113109 $ history = Middleware::history ($ container );
@@ -119,11 +115,9 @@ public function testRateLimitDetails()
119115 $ client = new IntercomClient ('u ' , 'p ' );
120116 $ client ->setClient ($ http_client );
121117
122- $ client ->users ->create (
123- [
118+ $ client ->users ->create ([
124119125- ]
126- );
120+ ]);
127121
128122 $ rateLimitDetails = $ client ->getRateLimitDetails ();
129123 $ this ->assertInternalType ('array ' , $ rateLimitDetails );
0 commit comments