3
3
namespace spec \Http \Client \Common ;
4
4
5
5
use Http \Client \Exception \TransferException ;
6
- use Http \Client \HttpClient ;
7
6
use Http \Client \HttpAsyncClient ;
8
7
use Http \Promise \Promise ;
9
8
use Psr \Http \Message \RequestInterface ;
12
11
13
12
class EmulatedHttpClientSpec extends ObjectBehavior
14
13
{
15
- function let (HttpAsyncClient $ httpAsyncClient )
14
+ public function let (HttpAsyncClient $ httpAsyncClient )
16
15
{
17
16
$ this ->beConstructedWith ($ httpAsyncClient );
18
17
}
19
18
20
- function it_is_initializable ()
19
+ public function it_is_initializable ()
21
20
{
22
21
$ this ->shouldHaveType ('Http\Client\Common\EmulatedHttpClient ' );
23
22
}
24
23
25
- function it_is_an_http_client ()
24
+ public function it_is_an_http_client ()
26
25
{
27
26
$ this ->shouldImplement ('Http\Client\HttpClient ' );
28
27
}
29
28
30
- function it_is_an_async_http_client ()
29
+ public function it_is_an_async_http_client ()
31
30
{
32
31
$ this ->shouldImplement ('Http\Client\HttpAsyncClient ' );
33
32
}
34
33
35
- function it_emulates_a_successful_request (
34
+ public function it_emulates_a_successful_request (
36
35
HttpAsyncClient $ httpAsyncClient ,
37
36
RequestInterface $ request ,
38
37
Promise $ promise ,
@@ -47,7 +46,7 @@ function it_emulates_a_successful_request(
47
46
$ this ->sendRequest ($ request )->shouldReturn ($ response );
48
47
}
49
48
50
- function it_emulates_a_failed_request (HttpAsyncClient $ httpAsyncClient , RequestInterface $ request , Promise $ promise )
49
+ public function it_emulates_a_failed_request (HttpAsyncClient $ httpAsyncClient , RequestInterface $ request , Promise $ promise )
51
50
{
52
51
$ promise ->wait ()->shouldBeCalled ();
53
52
$ promise ->getState ()->willReturn (Promise::REJECTED );
@@ -58,7 +57,7 @@ function it_emulates_a_failed_request(HttpAsyncClient $httpAsyncClient, RequestI
58
57
$ this ->shouldThrow ('Http\Client\Exception ' )->duringSendRequest ($ request );
59
58
}
60
59
61
- function it_decorates_the_underlying_client (
60
+ public function it_decorates_the_underlying_client (
62
61
HttpAsyncClient $ httpAsyncClient ,
63
62
RequestInterface $ request ,
64
63
Promise $ promise
0 commit comments