@@ -15,7 +15,7 @@ class ClientTest extends TestCase
1515 /** @var array */
1616 private $ headers ;
1717
18- protected function setUp ()
18+ protected function setUp (): void
1919 {
2020 $ this ->host = 'https://localhost:4010 ' ;
2121 $ this ->headers = [
@@ -27,13 +27,11 @@ protected function setUp()
2727
2828 public function testConstructor ()
2929 {
30- $ this ->assertAttributeEquals ($ this ->host , 'host ' , $ this ->client );
31- $ this ->assertAttributeEquals ($ this ->headers , 'headers ' , $ this ->client );
32- $ this ->assertAttributeEquals ('/v3 ' , 'version ' , $ this ->client );
33- $ this ->assertAttributeEquals ([], 'path ' , $ this ->client );
34- $ this ->assertAttributeEquals ([], 'curlOptions ' , $ this ->client );
35- $ this ->assertAttributeEquals (false , 'retryOnLimit ' , $ this ->client );
36- $ this ->assertAttributeEquals (['get ' , 'post ' , 'patch ' , 'put ' , 'delete ' ], 'methods ' , $ this ->client );
30+ $ this ->assertEquals ($ this ->host , $ this ->client ->getHost ());
31+ $ this ->assertEquals ($ this ->headers , $ this ->client ->getHeaders ());
32+ $ this ->assertEquals ('/v3 ' , $ this ->client ->getVersion ());
33+ $ this ->assertEquals ([], $ this ->client ->getPath ());
34+ $ this ->assertEquals ([], $ this ->client ->getCurlOptions ());
3735 }
3836
3937 public function test_ ()
@@ -42,34 +40,34 @@ public function test_()
4240 $ client ->setCurlOptions (['foo ' => 'bar ' ]);
4341 $ client = $ client ->_ ('test ' );
4442
45- $ this ->assertAttributeEquals (['test ' ], ' path ' , $ client );
46- $ this ->assertAttributeEquals (['foo ' => 'bar ' ], ' curlOptions ' , $ client );
43+ $ this ->assertEquals (['test ' ], $ client-> getPath () );
44+ $ this ->assertEquals (['foo ' => 'bar ' ], $ client-> getCurlOptions () );
4745 }
4846
4947 public function test__call ()
5048 {
5149 $ client = $ this ->client ->get ();
52- $ this ->assertAttributeEquals ('https://localhost:4010/v3/ ' , ' url ' , $ client );
50+ $ this ->assertEquals ('https://localhost:4010/v3/ ' , $ client-> url );
5351
5452 $ queryParams = ['limit ' => 100 , 'offset ' => 0 ];
5553 $ client = $ this ->client ->get (null , $ queryParams );
56- $ this ->assertAttributeEquals ('https://localhost:4010/v3/?limit=100&offset=0 ' , ' url ' , $ client );
54+ $ this ->assertEquals ('https://localhost:4010/v3/?limit=100&offset=0 ' , $ client-> url );
5755
5856 $ requestBody = ['name ' => 'A New Hope ' ];
5957 $ client = $ this ->client ->get ($ requestBody );
60- $ this ->assertAttributeEquals ($ requestBody , ' requestBody ' , $ client );
58+ $ this ->assertEquals ($ requestBody , $ client-> requestBody );
6159
6260 $ requestHeaders = ['X-Mock: 200 ' ];
6361 $ client = $ this ->client ->get (null , null , $ requestHeaders );
64- $ this ->assertAttributeEquals ($ requestHeaders , ' requestHeaders ' , $ client );
62+ $ this ->assertEquals ($ requestHeaders , $ client-> requestHeaders );
6563
6664 $ client = $ this ->client ->version ('/v4 ' );
67- $ this ->assertAttributeEquals ('/v4 ' , ' version ' , $ client );
65+ $ this ->assertEquals ('/v4 ' , $ client-> getVersion () );
6866
6967 $ client = $ this ->client ->path_to_endpoint ();
70- $ this ->assertAttributeEquals (['path_to_endpoint ' ], ' path ' , $ client );
68+ $ this ->assertEquals (['path_to_endpoint ' ], $ client-> getPath () );
7169 $ client = $ client ->one_more_segment ();
72- $ this ->assertAttributeEquals (['path_to_endpoint ' , 'one_more_segment ' ], ' path ' , $ client );
70+ $ this ->assertEquals (['path_to_endpoint ' , 'one_more_segment ' ], $ client-> getPath () );
7371 }
7472
7573 public function testGetHost ()
@@ -212,7 +210,7 @@ public function testThrowExceptionOnInvalidCall()
212210 public function testMakeRequestWithUntrustedRootCert ()
213211 {
214212 $ this ->expectException (InvalidRequest::class);
215- $ this ->expectExceptionMessageRegExp ('/certificate/i ' );
213+ $ this ->expectExceptionMessageMatches ('/certificate/i ' );
216214
217215 $ client = new Client ('https://untrusted-root.badssl.com/ ' );
218216 $ client ->makeRequest ('GET ' , 'https://untrusted-root.badssl.com/ ' );
@@ -223,12 +221,12 @@ public function testFormRepeatUrlArgs()
223221 $ client = new Client ('https://localhost:4010 ' );
224222
225223 $ testParams = [
226- 'thing ' => 'stuff ' ,
227- 'foo ' => [
228- 'bar ' ,
229- 'bat ' ,
230- 'baz ' ,
231- ],
224+ 'thing ' => 'stuff ' ,
225+ 'foo ' => [
226+ 'bar ' ,
227+ 'bat ' ,
228+ 'baz ' ,
229+ ],
232230 ];
233231 $ result = $ this ->callMethod ($ client , 'buildUrl ' , [$ testParams ]);
234232 $ this ->assertEquals ($ result , 'https://localhost:4010/?thing=stuff&foo=bar&foo=bat&foo=baz ' );
0 commit comments