Problem
The WordPress PHPUnit runner can enter bootstrap-mode=project without a loaded PHPUnit harness, then construct PHPUnit\Framework\TestSuite during test discovery. Projects whose native bootstrap does not load PHPUnit fail before any project tests execute:
BOOTSTRAP FAILURE: load_tests: Uncaught Error: Class "PHPUnit\Framework\TestSuite" not found
This was originally tracked as Extra-Chill/homeboy#8019. Ownership tracing shows Homeboy only delegates release tests to the WordPress extension, which delegates recipe construction to WP Codebox. The constructor is in packages/runtime-playground/src/phpunit-command-handlers.ts; project mode currently permits boot to continue without an autoloader before discovery reaches new PHPUnit\Framework\TestSuite(...).
Expected
The runtime must load or require the configured PHPUnit harness before constructing a test suite while preserving project-owned WordPress/bootstrap behavior. Missing harness configuration should fail with an actionable bootstrap error rather than an undefined PHPUnit class.
Acceptance criteria
- Reproduce project mode with a native bootstrap that does not load PHPUnit.
- Ensure the PHPUnit harness is initialized before
TestSuite construction.
- Preserve custom project bootstrap ordering and managed mode.
- Add deterministic regression coverage proving test discovery executes after harness initialization.
- Run the repository test/lint gates relevant to runtime-playground.
Problem
The WordPress PHPUnit runner can enter
bootstrap-mode=projectwithout a loaded PHPUnit harness, then constructPHPUnit\Framework\TestSuiteduring test discovery. Projects whose native bootstrap does not load PHPUnit fail before any project tests execute:This was originally tracked as Extra-Chill/homeboy#8019. Ownership tracing shows Homeboy only delegates release tests to the WordPress extension, which delegates recipe construction to WP Codebox. The constructor is in
packages/runtime-playground/src/phpunit-command-handlers.ts; project mode currently permits boot to continue without an autoloader before discovery reachesnew PHPUnit\Framework\TestSuite(...).Expected
The runtime must load or require the configured PHPUnit harness before constructing a test suite while preserving project-owned WordPress/bootstrap behavior. Missing harness configuration should fail with an actionable bootstrap error rather than an undefined PHPUnit class.
Acceptance criteria
TestSuiteconstruction.