Skip to content

Commit cd22f20

Browse files
dinooo13SimonFrings
authored andcommitted
Use reactphp/async instead of clue/reactphp-block
1 parent c5f8a2c commit cd22f20

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
"ringcentral/psr7": "^1.2"
1818
},
1919
"require-dev": {
20-
"clue/block-react": "^1.5",
2120
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
21+
"react/async": "^4 || ^3 || ^2",
2222
"react/event-loop": "^1.2",
23-
"react/http": "^1.5"
23+
"react/http": "^1.5",
24+
"react/promise-timer": "^1.10"
2425
},
2526
"autoload": {
2627
"psr-4": {

tests/FunctionalTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace Clue\Tests\React\HttpProxy;
44

5-
use Clue\React\Block;
65
use Clue\React\HttpProxy\ProxyConnector;
7-
use React\EventLoop\Loop;
86

97
/** @group internet */
108
class FunctionalTest extends AbstractTestCase
@@ -20,7 +18,7 @@ public function testNonListeningSocketRejectsConnection()
2018
'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED)',
2119
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
2220
);
23-
Block\await($promise, Loop::get(), 3.0);
21+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
2422
}
2523

2624
public function testPlainGoogleDoesNotAcceptConnectMethod()
@@ -34,7 +32,7 @@ public function testPlainGoogleDoesNotAcceptConnectMethod()
3432
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED)',
3533
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
3634
);
37-
Block\await($promise, Loop::get(), 3.0);
35+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
3836
}
3937

4038
public function testSecureGoogleDoesNotAcceptConnectMethod()
@@ -52,7 +50,7 @@ public function testSecureGoogleDoesNotAcceptConnectMethod()
5250
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 405 (Method Not Allowed) (ECONNREFUSED)',
5351
defined('SOCKET_ECONNREFUSED') ? SOCKET_ECONNREFUSED : 111
5452
);
55-
Block\await($promise, Loop::get(), 3.0);
53+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
5654
}
5755

5856
public function testSecureGoogleDoesNotAcceptPlainStream()
@@ -66,7 +64,7 @@ public function testSecureGoogleDoesNotAcceptPlainStream()
6664
'Connection to tcp://google.com:80 failed because connection to proxy was lost while waiting for response (ECONNRESET)',
6765
defined('SOCKET_ECONNRESET') ? SOCKET_ECONNRESET : 104
6866
);
69-
Block\await($promise, Loop::get(), 3.0);
67+
\React\Async\await(\React\Promise\Timer\timeout($promise, 3.0));
7068
}
7169

7270
/**

0 commit comments

Comments
 (0)