From c735803bda94c905f453ecabc5459247bd1269c7 Mon Sep 17 00:00:00 2001 From: Rik Meijer Date: Mon, 30 Oct 2023 14:57:27 +0100 Subject: [PATCH] replace HTTP_HOST with SERVE_HOST --- .github/workflows/php.yml | 2 +- serve.php | 2 +- tests/Feature/TestCase.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 831e26e..33ac75f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -42,7 +42,7 @@ jobs: - name: Start internal PHP Webserver to run feature tests env: - HTTP_HOST: "localhost:8000" + SERVE_HOST: "127.0.0.1:8000" run: nohup php serve.php 2>&1 & - name: Run test suite diff --git a/serve.php b/serve.php index 70bc18d..7bcee93 100644 --- a/serve.php +++ b/serve.php @@ -41,7 +41,7 @@ public function handleRequest(Request $request) : Response $errorHandler = new DefaultErrorHandler(); $server = SocketHttpServer::createForDirectAccess($logger); -$server->expose($_ENV['HTTP_HOST']); +$server->expose($_ENV['SERVE_HOST']); $server->start($requestHandler, $errorHandler); // Serve requests until SIGINT or SIGTERM is received by the process. diff --git a/tests/Feature/TestCase.php b/tests/Feature/TestCase.php index 3324c30..bebb4cd 100644 --- a/tests/Feature/TestCase.php +++ b/tests/Feature/TestCase.php @@ -9,7 +9,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase private $curl; public function open(string $path) { - $this->curl = curl_init('http://' . $_ENV['HTTP_HOST'] . $path); + $this->curl = curl_init('http://' . $_ENV['SERVE_HOST'] . $path); curl_setopt_array($this->curl, [ CURLOPT_HTTPHEADER => [ 'Accept: text/html'