Skip to content

Commit b919e5a

Browse files
committed
Use reactphp/async instead of clue/reactphp-block
1 parent 09366dd commit b919e5a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"ringcentral/psr7": "^1.2"
1818
},
1919
"require-dev": {
20-
"clue/block-react": "^1.5",
20+
"react/async": "^4 || ^3 || ^2",
2121
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8",
2222
"react/event-loop": "^1.2",
2323
"react/http": "^1.5"

tests/FunctionalTest.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Clue\Tests\React\HttpProxy;
44

5-
use Clue\React\Block;
65
use Clue\React\HttpProxy\ProxyConnector;
76
use React\EventLoop\Loop;
87

@@ -20,7 +19,7 @@ public function testNonListeningSocketRejectsConnection()
2019
'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED)',
2120
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
2221
);
23-
Block\await($promise, Loop::get(), 3.0);
22+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
2423
}
2524

2625
public function testPlainGoogleDoesNotAcceptConnectMethod()
@@ -34,7 +33,7 @@ public function testPlainGoogleDoesNotAcceptConnectMethod()
3433
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED)',
3534
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
3635
);
37-
Block\await($promise, Loop::get(), 3.0);
36+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
3837
}
3938

4039
public function testSecureGoogleDoesNotAcceptConnectMethod()
@@ -52,7 +51,7 @@ public function testSecureGoogleDoesNotAcceptConnectMethod()
5251
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED)',
5352
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
5453
);
55-
Block\await($promise, Loop::get(), 3.0);
54+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
5655
}
5756

5857
public function testSecureGoogleDoesNotAcceptPlainStream()
@@ -66,7 +65,7 @@ public function testSecureGoogleDoesNotAcceptPlainStream()
6665
'Connection to tcp://google.com:80 failed because connection to proxy was lost while waiting for response (ECONNRESET)',
6766
defined('SOCKET_ECONNRESET') ? SOCKET_ECONNRESET : 104
6867
);
69-
Block\await($promise, Loop::get(), 3.0);
68+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
7069
}
7170

7271
/**

0 commit comments

Comments
 (0)