Skip to content

Testing: ThrowsWeb uncaught HTTP 500 serve smoke (presenter negative path) #2200

Description

@PurHur

Problem

007-ThrowsWeb VM smoke (#2093 ✅, #2125 ✅) covers the caught invalid POST path (email=bad → HTML “invalid”). The README documents uncaught exceptions mapping to HTTP 500 via phpc serve (#152 ✅), but there is no automated curl asserting status 500 on an uncaught throw route.

Presenters can regress #152 mapping while caught-path curls stay green.

Goal

Add an opt-in gate (default-off first; flip after green):

  1. THROWSWEB_UNCAUGHT_500_GATE=1 runs a serve + curl expecting HTTP 500
  2. Wire into script/examples-web-smoke.sh (--throws-uncaught-only or extend --throws-only)
  3. Document in examples/007-ThrowsWeb/README.md and docs/GETTING-STARTED.md §5b

Suggested fixture

Add examples/007-ThrowsWeb/uncaught.php or a query flag on example.php that throws outside try/catch (minimal, presenter-safe).

Implementation hints

Piece Path Notes
Smoke script/examples-web-smoke.sh curl -sf -o /dev/null -w '%{http_code}' expects 500
Env script/ci-defaults.env THROWSWEB_UNCAUGHT_500_GATE="${...:-0}"
CI script/ci-fast.sh via ci-common.sh After caught smoke stable
Serve lib/Web/DevServer.php #152 mapping — assert no regression

Acceptance criteria

THROWSWEB_UNCAUGHT_500_GATE=1 ./script/examples-web-smoke.sh --throws-only
./script/ci-fast.sh --filter ThrowsWebUncaught

Harness:

./script/docker-exec.sh -- bash -lc 'THROWSWEB_UNCAUGHT_500_GATE=1 ./script/examples-web-smoke.sh --throws-only'

Dependencies

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions