Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reactphp/async instead of clue/reactphp-block #50

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -17,7 +17,7 @@
"ringcentral/psr7": "^1.2"
},
"require-dev": {
"clue/block-react": "^1.5",
"react/async": "^4 || ^3 || ^2",
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8",
"react/event-loop": "^1.2",
"react/http": "^1.5"
Expand Down
10 changes: 4 additions & 6 deletions tests/FunctionalTest.php
Expand Up @@ -2,9 +2,7 @@

namespace Clue\Tests\React\HttpProxy;

use Clue\React\Block;
use Clue\React\HttpProxy\ProxyConnector;
use React\EventLoop\Loop;

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

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

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

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

/**
Expand Down