Skip to content

Commit

Permalink
wait for the server to boot
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Mar 10, 2024
1 parent 42bf760 commit 1b82ef3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/FunctionalTest.php
Expand Up @@ -33,7 +33,6 @@ public function setUp(): void
Command::foreground('php fixtures/server.php')
->withEnvironment('PATH', \getenv('PATH')),
);
var_dump($this->server->output()->toString());
}

public function tearDown(): void
Expand All @@ -49,8 +48,15 @@ public function tearDown(): void

public function testServerRespond()
{
// let time for the server to boot
\sleep(1);
$found = $this
->server
->output()
->chunks()
->find(static fn($pair) => $pair[0]->startsWith('HTTP server ready!'));
$this->assertTrue($found->match(
static fn() => true,
static fn() => false,
));

$response = $this
->os
Expand Down

0 comments on commit 1b82ef3

Please sign in to comment.