22
33namespace spec \Http \Client \Common ;
44
5- use Http \Client \Common \HttpAsyncClientDecorator ;
6- use Http \Client \Common \HttpClientDecorator ;
7- use Http \Client \Common \FlexibleHttpClient ;
85use Http \Client \HttpAsyncClient ;
96use Http \Client \HttpClient ;
107use Http \Promise \Promise ;
118use Psr \Http \Message \RequestInterface ;
129use Psr \Http \Message \ResponseInterface ;
1310use PhpSpec \ObjectBehavior ;
14- use Prophecy \Prophet ;
1511
1612class FlexibleHttpClientSpec extends ObjectBehavior
1713{
@@ -79,7 +75,7 @@ function it_emulates_a_client(
7975 $ this ->sendRequest ($ syncRequest )->shouldReturn ($ syncResponse );
8076 }
8177
82- function it_does_not_emulate_a_client (FlexibleHttpClient $ client , RequestInterface $ syncRequest , RequestInterface $ asyncRequest )
78+ function it_does_not_emulate_a_client (CombinedHttpClient $ client , RequestInterface $ syncRequest , RequestInterface $ asyncRequest )
8379 {
8480 $ client ->sendRequest ($ syncRequest )->shouldBeCalled ();
8581 $ client ->sendRequest ($ asyncRequest )->shouldNotBeCalled ();
@@ -92,3 +88,22 @@ function it_does_not_emulate_a_client(FlexibleHttpClient $client, RequestInterfa
9288 $ this ->sendAsyncRequest ($ asyncRequest );
9389 }
9490}
91+
92+ class CombinedHttpClient implements HttpClient, HttpAsyncClient
93+ {
94+ /**
95+ * @param RequestInterface $request
96+ */
97+ public function sendRequest (RequestInterface $ request )
98+ {
99+ // TODO: Implement sendRequest() method.
100+ }
101+
102+ /**
103+ * @param RequestInterface $request
104+ */
105+ public function sendAsyncRequest (RequestInterface $ request )
106+ {
107+ // TODO: Implement sendAsyncRequest() method.
108+ }
109+ }
0 commit comments