2
2
3
3
namespace Clue \Tests \React \HttpProxy ;
4
4
5
- use Clue \React \Block ;
6
5
use Clue \React \HttpProxy \ProxyConnector ;
7
6
use React \EventLoop \Loop ;
8
7
@@ -20,7 +19,7 @@ public function testNonListeningSocketRejectsConnection()
20
19
'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED) ' ,
21
20
defined ('SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
22
21
);
23
- Block \ await ($ promise , Loop:: get (), 3.0 );
22
+ \ React \ Async \ await (\ React \ Promise \ Timer \timeout ( $ promise , 3.0 ) );
24
23
}
25
24
26
25
public function testPlainGoogleDoesNotAcceptConnectMethod ()
@@ -34,7 +33,7 @@ public function testPlainGoogleDoesNotAcceptConnectMethod()
34
33
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED) ' ,
35
34
defined ('SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
36
35
);
37
- Block \ await ($ promise , Loop:: get (), 3.0 );
36
+ \ React \ Async \ await (\ React \ Promise \ Timer \timeout ( $ promise , 3.0 ) );
38
37
}
39
38
40
39
public function testSecureGoogleDoesNotAcceptConnectMethod ()
@@ -52,7 +51,7 @@ public function testSecureGoogleDoesNotAcceptConnectMethod()
52
51
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED) ' ,
53
52
defined ('SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
54
53
);
55
- Block \ await ($ promise , Loop:: get (), 3.0 );
54
+ \ React \ Async \ await (\ React \ Promise \ Timer \timeout ( $ promise , 3.0 ) );
56
55
}
57
56
58
57
public function testSecureGoogleDoesNotAcceptPlainStream ()
@@ -66,7 +65,7 @@ public function testSecureGoogleDoesNotAcceptPlainStream()
66
65
'Connection to tcp://google.com:80 failed because connection to proxy was lost while waiting for response (ECONNRESET) ' ,
67
66
defined ('SOCKET_ECONNRESET ' ) ? SOCKET_ECONNRESET : 104
68
67
);
69
- Block \ await ($ promise , Loop:: get (), 3.0 );
68
+ \ React \ Async \ await (\ React \ Promise \ Timer \timeout ( $ promise , 3.0 ) );
70
69
}
71
70
72
71
/**
0 commit comments