File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
/.php_cs.cache
2
2
/behat.yml
3
+ /bin /
3
4
/build /
4
5
/composer.lock
5
6
/phpspec.yml
Original file line number Diff line number Diff line change 53
53
"php-http/guzzle6-adapter" : " ^1.1.1 || ^2.0.1" ,
54
54
"php-http/mock-client" : " ^1.2" ,
55
55
"php-http/promise" : " ^1.0" ,
56
+ "phpunit/phpunit" : " 7.5.*" ,
56
57
"polishsymfonycommunity/symfony-mocker-container" : " ^1.0" ,
57
58
"symfony/browser-kit" : " ^3.4.20 || ^4.2.1" ,
58
59
"symfony/cache" : " ^3.4.20 || ^4.2.1" ,
71
72
"twig/twig" : " Add this to your require-dev section when using the WebProfilerBundle"
72
73
},
73
74
"config" : {
74
- "sort-packages" : true
75
+ "sort-packages" : true ,
76
+ "bin-dir" : " bin"
75
77
},
76
78
"extra" : {
77
79
"branch-alias" : {
Original file line number Diff line number Diff line change 14
14
use Http \Promise \FulfilledPromise ;
15
15
use Http \Promise \Promise ;
16
16
use Http \Promise \RejectedPromise ;
17
+ use PHPUnit \Framework \MockObject \MockObject ;
17
18
use PHPUnit \Framework \TestCase ;
18
19
use Psr \Http \Message \RequestInterface ;
19
20
use Psr \Http \Message \ResponseInterface ;
@@ -34,7 +35,7 @@ class ProfileClientTest extends TestCase
34
35
private $ activeStack ;
35
36
36
37
/**
37
- * @var HttpClient
38
+ * @var HttpClient|MockObject
38
39
*/
39
40
private $ client ;
40
41
@@ -145,6 +146,16 @@ public function testSendRequest(): void
145
146
$ this ->assertEquals ('https ' , $ this ->activeStack ->getRequestScheme ());
146
147
}
147
148
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
+
148
159
public function testSendAsyncRequest (): void
149
160
{
150
161
$ this ->client
You can’t perform that action at this time.
0 commit comments