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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test suite to use new reactphp/async package instead of clue/reactphp-block #57

Merged
merged 1 commit into from
Apr 10, 2024
Merged
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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
"ringcentral/psr7": "^1.2"
},
"require-dev": {
"clue/block-react": "^1.5",
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36",
"react/async": "^4 || ^3 || ^2",
"react/event-loop": "^1.2",
"react/http": "^1.5"
"react/http": "^1.5",
"react/promise-timer": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 4 additions & 6 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
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