Add test group to skip integration tests relying on internet connection by clue · Pull Request #146 · reactphp/socket · GitHub
Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
17 changes: 1 addition & 16 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use React\Socket\SecureConnector;
use React\Socket\TcpConnector;

/** @group internet */
class IntegrationTest extends TestCase
{
const TIMEOUT = 5.0;
Expand Down Expand Up @@ -167,20 +168,4 @@ public function testSelfSignedResolvesIfVerificationIsDisabled()
// if we reach this, then everything is good
$this->assertNull(null);
}

public function testCancelPendingConnection()
{
$loop = Factory::create();

$connector = new TcpConnector($loop);
$pending = $connector->connect('8.8.8.8:80');

$loop->addTimer(0.001, function () use ($pending) {
$pending->cancel();
});

$pending->then($this->expectCallableNever(), $this->expectCallableOnce());

$loop->run();
}
}
42 changes: 42 additions & 0 deletions tests/TcpConnectorTest.php