Skip to content

Testing: CgiDriverTest VM smoke for bin/cgi.php (parent #50) #656

@PurHur

Description

@PurHur

Problem

#50 tracks bin/cgi.php (CGI/1.1 stdin/env driver). There is no PHPUnit harness proving a compiled or VM script produces correct Status: + headers + body when invoked like nginx would (env vars only, no TCP).

Without a test, CGI regressions slip past ci-fast.sh until manual nginx setup.

Goal

test/real/CgiDriverTest.php (or PHPT under test/real/cases/):

  1. Phase A (VM): After Web: CGI/1.1 request driver (stdin/stdout, env, Status line) #50 lands bin/cgi.php, run examples/001-SimpleWeb/example.php with:
    • REQUEST_METHOD=GET, QUERY_STRING=name=CgiTest, SCRIPT_NAME=/example.php
    • Assert stdout contains Status: 200, Content-Type: text/html, and CgiTest in body
  2. Phase B (AOT, optional): When Testing: ExamplesCompileTest AOT execute smoke (002-StaticWeb build + run) #247-style execute smoke exists for 001, repeat with compiled binary behind thin shim (document in test skip until green)

Skip when PHP_COMPILER_SKIP_SERVE_TESTS=1 (same as ServeTest).

Implementation hints

Piece Notes
Runner proc_open on php bin/cgi.php <path> with env array — no loopback
Fixture Start from 001-SimpleWeb; avoid MiniWebApp until #568
Parent #50 implements driver; this issue only tests
Docs One curl-free recipe in docs/deploy-web-aot.md stub (#635)

Acceptance criteria

./script/ci-fast.sh --filter CgiDriverTest

Blocked until #50 — use markTestSkipped('bin/cgi.php not shipped (#50)') until then.

Docker:

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./script/ci-fast.sh --filter CgiDriverTest

Dependencies

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions