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