@@ -35,7 +35,7 @@ final class ClientTest extends TestCase
3535 /**
3636 * Tests a API call with GET method.
3737 */
38- public function testGet ()
38+ public function testGet (): void
3939 {
4040 $ client = $ this ->createClient (new Response (200 , [], '{"foo":"baz"} ' ));
4141 $ result = $ client ->get ('test ' );
@@ -49,7 +49,7 @@ public function testGet()
4949 /**
5050 * Tests a API call with POST method.
5151 */
52- public function testPost ()
52+ public function testPost (): void
5353 {
5454 $ client = $ this ->createClient (new Response (200 , [], '{"foo":"baz"} ' ));
5555 $ result = $ client ->post ('test ' , ['key ' => 'value ' ]);
@@ -68,7 +68,7 @@ public function testPost()
6868 /**
6969 * Tests a API call with PUT method.
7070 */
71- public function testPut ()
71+ public function testPut (): void
7272 {
7373 $ client = $ this ->createClient (new Response (200 , [], '{"foo":"baz"} ' ));
7474 $ result = $ client ->put ('test ' , ['key ' => 'value ' ]);
@@ -82,7 +82,7 @@ public function testPut()
8282 /**
8383 * Tests a API call with DELETE method.
8484 */
85- public function testDelete ()
85+ public function testDelete (): void
8686 {
8787 $ client = $ this ->createClient (new Response (200 , [], '{"foo":"baz"} ' ));
8888 $ result = $ client ->delete ('test ' );
@@ -96,7 +96,7 @@ public function testDelete()
9696 /**
9797 * Tests API calls that returns errors.
9898 */
99- public function testGenericErrors ()
99+ public function testGenericErrors (): void
100100 {
101101 $ client = $ this ->createClient (new Response (400 ));
102102 $ result = $ client ->get ('test ' );
@@ -106,7 +106,7 @@ public function testGenericErrors()
106106 $ this ->assertEquals ([], $ result ->getErrors ());
107107 }
108108
109- public function testMessageError ()
109+ public function testMessageError (): void
110110 {
111111 $ client = $ this ->createClient (
112112 new Response (404 , [], '{"message":"No Result found for Subscriber with id 18"} ' ),
@@ -132,7 +132,7 @@ public function testMessageError()
132132 *
133133 * @link https://developers.activecampaign.com/reference#errors
134134 */
135- public function testExplainedErrors ()
135+ public function testExplainedErrors (): void
136136 {
137137 $ client = $ this ->createClient (new Response (
138138 400 ,
@@ -164,7 +164,7 @@ public function testExplainedErrors()
164164 $ this ->assertEquals ($ errors , $ result ->getErrors ());
165165 }
166166
167- public function testGenericGuzzleException ()
167+ public function testGenericGuzzleException (): void
168168 {
169169 $ client = $ this ->createClient (new GenericGuzzleException ('The exception message ' ));
170170 $ result = $ client ->get ('test ' );
@@ -182,23 +182,19 @@ public function testGenericGuzzleException()
182182 $ this ->assertEquals ($ errors , $ result ->getErrors ());
183183 }
184184
185- public function testCorrectCredentials ()
185+ public function testCorrectCredentials (): void
186186 {
187187 $ client = $ this ->createClient (new Response (200 , [], '{"user":{}} ' ));
188188 $ this ->assertTrue ($ client ->testCredentials ());
189189 }
190190
191- public function testWrongCredentials ()
191+ public function testWrongCredentials (): void
192192 {
193193 $ client = $ this ->createClient (new Response (403 ));
194194 $ this ->assertFalse ($ client ->testCredentials ());
195195 }
196196
197- /**
198- * @param mixed $expectedResponse
199- * @return GuzzleClient
200- */
201- private function createGuzzleClient ($ expectedResponse )
197+ private function createGuzzleClient ($ expectedResponse ): GuzzleClient
202198 {
203199 $ mock = new MockHandler ([
204200 $ expectedResponse ,
@@ -212,11 +208,7 @@ private function createGuzzleClient($expectedResponse)
212208 return new GuzzleClient (['handler ' => $ handler ]);
213209 }
214210
215- /**
216- * @param mixed $expectedResponse
217- * @return Client
218- */
219- private function createClient ($ expectedResponse )
211+ private function createClient ($ expectedResponse ): Client
220212 {
221213 return new Client (
222214 'http://example.com ' ,
@@ -225,13 +217,7 @@ private function createClient($expectedResponse)
225217 );
226218 }
227219
228- /**
229- * @param RequestInterface $request
230- * @param string $method
231- * @param string $uri
232- * @param string $body
233- */
234- private function assertRequest (RequestInterface $ request , $ method , $ uri , $ body = null )
220+ private function assertRequest (RequestInterface $ request , string $ method , string $ uri , string $ body = null ): void
235221 {
236222 $ this ->assertEquals ($ method , $ request ->getMethod ());
237223 $ this ->assertEquals ($ uri , $ request ->getUri ()->__toString ());
0 commit comments