@@ -20,7 +20,7 @@ protected function setUp()
2020 'Content-Type: application/json ' ,
2121 'Authorization: Bearer SG.XXXX '
2222 ];
23- $ this ->client = new MockClient ($ this ->host , $ this ->headers , ' /v3 ' , null , null );
23+ $ this ->client = new MockClient ($ this ->host , $ this ->headers );
2424 }
2525
2626 public function testConstructor ()
@@ -30,12 +30,14 @@ public function testConstructor()
3030 $ this ->assertAttributeEquals ('/v3 ' , 'version ' , $ this ->client );
3131 $ this ->assertAttributeEquals ([], 'path ' , $ this ->client );
3232 $ this ->assertAttributeEquals ([], 'curlOptions ' , $ this ->client );
33- $ this ->assertAttributeEquals (['delete ' , 'get ' , 'patch ' , 'post ' , 'put ' ], 'methods ' , $ this ->client );
33+ $ this ->assertAttributeEquals (false , 'retryOnLimit ' , $ this ->client );
34+ $ this ->assertAttributeEquals (['get ' , 'post ' , 'patch ' , 'put ' , 'delete ' ], 'methods ' , $ this ->client );
3435 }
3536
3637 public function test_ ()
3738 {
38- $ client = new MockClient ($ this ->host , $ this ->headers , '/v3 ' , null , ['foo ' => 'bar ' ]);
39+ $ client = new MockClient ($ this ->host , $ this ->headers , '/v3 ' );
40+ $ client ->setCurlOptions (['foo ' => 'bar ' ]);
3941 $ client = $ client ->_ ('test ' );
4042
4143 $ this ->assertAttributeEquals (['test ' ], 'path ' , $ client );
@@ -79,34 +81,35 @@ public function testGetHeaders()
7981 $ client = new Client ('https://localhost:4010 ' , ['Content-Type: application/json ' , 'Authorization: Bearer SG.XXXX ' ]);
8082 $ this ->assertSame (['Content-Type: application/json ' , 'Authorization: Bearer SG.XXXX ' ], $ client ->getHeaders ());
8183
82- $ client2 = new Client ('https://localhost:4010 ' , null );
84+ $ client2 = new Client ('https://localhost:4010 ' );
8385 $ this ->assertSame ([], $ client2 ->getHeaders ());
8486 }
8587
8688 public function testGetVersion ()
8789 {
88- $ client = new Client ('https://localhost:4010 ' , null , '/v3 ' );
90+ $ client = new Client ('https://localhost:4010 ' , [] , '/v3 ' );
8991 $ this ->assertSame ('/v3 ' , $ client ->getVersion ());
9092
91- $ client = new Client ('https://localhost:4010 ' , null , null );
92- $ this ->assertSame (null , $ client ->getVersion ());
93+ $ client = new Client ('https://localhost:4010 ' );
94+ $ this ->assertSame (' /v3 ' , $ client ->getVersion ());
9395 }
9496
9597 public function testGetPath ()
9698 {
97- $ client = new Client ('https://localhost:4010 ' , null , null , ['/foo/bar ' ]);
99+ $ client = new Client ('https://localhost:4010 ' , [] , null , ['/foo/bar ' ]);
98100 $ this ->assertSame (['/foo/bar ' ], $ client ->getPath ());
99101
100- $ client = new Client ('https://localhost:4010 ' , null , null , null );
102+ $ client = new Client ('https://localhost:4010 ' );
101103 $ this ->assertSame ([], $ client ->getPath ());
102104 }
103105
104106 public function testGetCurlOptions ()
105107 {
106- $ client = new Client ('https://localhost:4010 ' , null , null , null , [CURLOPT_PROXY => '127.0.0.1:8080 ' ]);
108+ $ client = new Client ('https://localhost:4010 ' );
109+ $ client ->setCurlOptions ([CURLOPT_PROXY => '127.0.0.1:8080 ' ]);
107110 $ this ->assertSame ([CURLOPT_PROXY => '127.0.0.1:8080 ' ], $ client ->getCurlOptions ());
108111
109- $ client = new Client ('https://localhost:4010 ' , null , null , null , null );
112+ $ client = new Client ('https://localhost:4010 ' );
110113 $ this ->assertSame ([], $ client ->getCurlOptions ());
111114 }
112115}
0 commit comments