… under the Playground SAPI
The STDOUT/STDERR PHP constants only exist under the CLI SAPI. The host
smoke harness runs these tests under the WP Codebox Playground web SAPI
where they are undefined, causing any reaching test to throw
'Undefined constant STDOUT'.
Replace every `fwrite( STDOUT, ... )` / `fwrite( STDERR, ... )` call in
the smoke suite with the equivalent `fopen( 'php://stdout'|'php://stderr', 'w' )`
stream target. Message arguments and formatting are unchanged; only the
stream target moves. This matches the form already in use by
tests/conversation-compaction-policy-resolver-smoke.php on main.
Mechanical sweep: 47 files, 75 call sites. Verified via
`grep -rE "fwrite\(\s*STD(OUT|ERR)" tests/` returning no matches and
php -l clean on every changed file.
Closes #2823
Summary
Closes #2823.
The
STDOUT/STDERRPHP constants only exist under the CLI SAPI. The host smoke harness runs these tests under the WP Codebox Playground web SAPI, where they are undefined, so any test reaching such a write throwsFatal error: Undefined constant "STDOUT"(orSTDERR).This is a purely mechanical sweep: replace every
fwrite( STDOUT, ... )/fwrite( STDERR, ... )call with the equivalentfopen( 'php://stdout'|'php://stderr', 'w' )stream target. Message arguments, formatting, indentation, and assertion logic are unchanged — only the stream target moves. This matches the form already in use bytests/conversation-compaction-policy-resolver-smoke.phponmain(the reference fix).Scope
STDERR+ 7STDOUT)fwrite( STDOUT|STDERR, ... )stream targets touched. No assertions, no behavior, no non-test files.Verification
grep -rE "fwrite\(\s*STD(OUT|ERR)" tests/→ no matches (clean).php -lclean on all 47 changed files.homeboy lint --changed-since origin/main→ passed, 0 findings.php tests/runtime-agent-bundle-reconcile-smoke.php→Runtime agent bundle reconcile smoke passed.php tests/content-addressed-data-packets-smoke.php→content-addressed-data-packets-smoke: okTransformation applied
Single quotes chosen to match the existing convention in
tests/(all pre-existingfopencalls and the reference fix onmainuse single quotes).Notes
internal.io_error/ "Setup command failed with exit code 100" / "No command results produced", that is infra, not this change.