Skip to content

Playground PHPUnit bootstrap fails when Composer platform check writes to undefined STDERR #1893

Description

@chubes4

Problem

A Homeboy-scoped WordPress PHPUnit run using WP Codebox Playground fails before any tests execute when a staged plugin's Composer platform_check.php reports a platform mismatch. The generated check calls fwrite(STDERR, ...), but STDERR is undefined in the Playground eval context.

Reproduction

Run a WordPress PHPUnit recipe against a Composer-backed plugin whose staged dependency platform check fails. Current observed command:

homeboy review test extrachill-api --path /var/lib/datamachine/workspace/extrachill-api@feat-227-concert-privacy --placement local --skip-lint -- --filter 'Concert_Tracking_RoutesTest|User_Settings_Privacy_RoutesTest|UserLocalSceneAdaptersTest'

Bootstrap fails in load_component:

Error: Undefined constant "STDERR" at /wordpress/wp-content/plugins/extrachill-api/vendor/composer/platform_check.php:17

The trace reaches the plugin Composer autoloader from the Playground internal evaluator, before PHPUnit can run.

Expected

The test environment should expose CLI stream constants when executing CLI-style PHPUnit workloads, or capture/report the underlying Composer platform mismatch without replacing it with an undefined-constant fatal.

Impact

No test assertions execute, and the actual dependency/platform diagnostic is obscured by the missing runtime constant.

Observed with WP Codebox 0.12.14, @automattic/wp-codebox-core 0.12.14, @automattic/wp-codebox-playground 0.12.14, WordPress Playground latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions