Problem
test/real/ServeTest.php and test/real/ServeAotTest.php only exercise GET requests (httpGet). lib/Web/DevServer.php already passes REQUEST_BODY into Superglobals::populateFromEnvironment(), and PHPT cases under test/real/cases/web_post.phpt cover VM-style POST parsing — but no integration test proves phpc serve / bin/serve.php accepts a POST body end-to-end.
#67 / #210 MiniWebApp needs POST /contact; without a serve-level test, regressions in DevServer body reading or $_POST population will not fail CI.
Goal
Add ServeTest::testPostFormUrlencoded (name TBD) that:
- Starts serve against a tiny docroot with
form.php reading $_POST['name']
- Sends
POST /form.php with Content-Type: application/x-www-form-urlencoded body
- Asserts
200 and echoed field value
Optional follow-up: mirror in ServeAotTest when AOT POST refresh is ready (#49).
Implementation hints
- Reuse
ServeTest::httpGet() pattern; add httpPost($docroot, $path, $body, $headers = []) using stream_socket_client + raw HTTP/1.1 request (same as existing helper).
- Fixture script:
<?php
header('Content-Type: text/plain');
echo 'name=', $_POST['name'] ?? 'missing';
Acceptance criteria
./script/ci-local.sh --filter ServeTest::testPost
# or full suite when serve tests enabled:
./script/docker-ci-local.sh
→ POST test runs (not skipped) unless PHP_COMPILER_SKIP_SERVE_TESTS=1.
Verification (local only)
Do not require GitHub Actions. GHA may skip serve tests; Docker/local must not.
Dependencies
Blocks
Files
test/real/ServeTest.php
lib/Web/DevServer.php, lib/Web/Superglobals.php
Problem
test/real/ServeTest.phpandtest/real/ServeAotTest.phponly exercise GET requests (httpGet).lib/Web/DevServer.phpalready passesREQUEST_BODYintoSuperglobals::populateFromEnvironment(), and PHPT cases undertest/real/cases/web_post.phptcover VM-style POST parsing — but no integration test provesphpc serve/bin/serve.phpaccepts a POST body end-to-end.#67 / #210 MiniWebApp needs
POST /contact; without a serve-level test, regressions in DevServer body reading or$_POSTpopulation will not fail CI.Goal
Add
ServeTest::testPostFormUrlencoded(name TBD) that:form.phpreading$_POST['name']POST /form.phpwithContent-Type: application/x-www-form-urlencodedbody200and echoed field valueOptional follow-up: mirror in
ServeAotTestwhen AOT POST refresh is ready (#49).Implementation hints
ServeTest::httpGet()pattern; addhttpPost($docroot, $path, $body, $headers = [])usingstream_socket_client+ raw HTTP/1.1 request (same as existing helper).DevServersetsREQUEST_BODYfrom request body — seelib/Web/DevServer.php~line 116.PHP_COMPILER_SKIP_SERVE_TESTSlike other serve tests (Testing: Run HTTP serve integration tests in Docker local CI #234).Acceptance criteria
./script/ci-local.sh --filter ServeTest::testPost # or full suite when serve tests enabled: ./script/docker-ci-local.sh→ POST test runs (not skipped) unless
PHP_COMPILER_SKIP_SERVE_TESTS=1.Verification (local only)
Do not require GitHub Actions. GHA may skip serve tests; Docker/local must not.
Dependencies
$_POST— optional ServeAotTest extension)Blocks
Files
test/real/ServeTest.phplib/Web/DevServer.php,lib/Web/Superglobals.php