Skip to content

Commit

Permalink
Tweaks the fake process creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Dec 18, 2024
1 parent 09a8ac8 commit 83f2e0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/Feature/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public function it_detects_a_port_conflict()
private function bindFakeProcessToPort(int $port, $callback)
{
$socket = socket_create(domain: AF_INET, type: SOCK_STREAM, protocol: SOL_TCP);

assert($socket !== false, 'Was not able to create a socket.');
assert(socket_bind($socket, '127.0.0.1', $port) !== false, "Was not able to bind socket to port {$port}");
assert(socket_listen($socket, backlog: 5));
assert(socket_listen($socket));

try {
$callback();
Expand Down

0 comments on commit 83f2e0d

Please sign in to comment.