Improve test suite, clean up leftover `.sock` files by clue · Pull Request #301 · 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
3 changes: 3 additions & 0 deletions tests/FdServerTest.php
3 changes: 3 additions & 0 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public function testConstructorCreatesExpectedUnixServer()
->then($this->expectCallableOnce(), $this->expectCallableNever());

$connection = \React\Async\await(\React\Promise\Timer\timeout($connector->connect($server->getAddress()), self::TIMEOUT));
assert($connection instanceof ConnectionInterface);

unlink(str_replace('unix://', '', $connection->getRemoteAddress()));

$connection->close();
$server->close();
Expand Down
4 changes: 4 additions & 0 deletions tests/SocketServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ public function testConstructorCreatesExpectedUnixServer()
->then($this->expectCallableOnce(), $this->expectCallableNever());

$connection = \React\Async\await(\React\Promise\Timer\timeout($connector->connect($socket->getAddress()), self::TIMEOUT));
assert($connection instanceof ConnectionInterface);

unlink(str_replace('unix://', '', $connection->getRemoteAddress()));

$connection->close();
$socket->close();
}

Expand Down
53 changes: 45 additions & 8 deletions tests/UnixServerTest.php