2
2
3
3
namespace spec \Http \Client \Common ;
4
4
5
- use Http \Client \Common \HttpAsyncClientDecorator ;
6
- use Http \Client \Common \HttpClientDecorator ;
7
- use Http \Client \Common \FlexibleHttpClient ;
8
5
use Http \Client \HttpAsyncClient ;
9
6
use Http \Client \HttpClient ;
10
7
use Http \Promise \Promise ;
11
8
use Psr \Http \Message \RequestInterface ;
12
9
use Psr \Http \Message \ResponseInterface ;
13
10
use PhpSpec \ObjectBehavior ;
14
- use Prophecy \Prophet ;
15
11
16
12
class FlexibleHttpClientSpec extends ObjectBehavior
17
13
{
@@ -79,7 +75,7 @@ function it_emulates_a_client(
79
75
$ this ->sendRequest ($ syncRequest )->shouldReturn ($ syncResponse );
80
76
}
81
77
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 )
83
79
{
84
80
$ client ->sendRequest ($ syncRequest )->shouldBeCalled ();
85
81
$ client ->sendRequest ($ asyncRequest )->shouldNotBeCalled ();
@@ -92,3 +88,22 @@ function it_does_not_emulate_a_client(FlexibleHttpClient $client, RequestInterfa
92
88
$ this ->sendAsyncRequest ($ asyncRequest );
93
89
}
94
90
}
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