Skip to content

Commit 6ed9ff4

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

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy