File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1414use Http \Promise \FulfilledPromise ;
1515use Http \Promise \Promise ;
1616use Http \Promise \RejectedPromise ;
17+ use PHPUnit \Framework \MockObject \MockObject ;
1718use PHPUnit \Framework \TestCase ;
1819use Psr \Http \Message \RequestInterface ;
1920use Psr \Http \Message \ResponseInterface ;
@@ -34,7 +35,7 @@ class ProfileClientTest extends TestCase
3435 private $ activeStack ;
3536
3637 /**
37- * @var HttpClient
38+ * @var HttpClient|MockObject
3839 */
3940 private $ client ;
4041
@@ -145,6 +146,16 @@ public function testSendRequest(): void
145146 $ this ->assertEquals ('https ' , $ this ->activeStack ->getRequestScheme ());
146147 }
147148
149+ public function testSendRequestTypeError ()
150+ {
151+ $ this ->client
152+ ->expects ($ this ->once ())
153+ ->method ('sendRequest ' )
154+ ->willThrowException (new \TypeError ('You set string to int prop ' ));
155+
156+ $ response = $ this ->subject ->sendRequest ($ this ->request );
157+ }
158+
148159 public function testSendAsyncRequest (): void
149160 {
150161 $ this ->client
You can’t perform that action at this time.
0 commit comments