Skip to content

fix(phpunit): load project-autoload-file before the project bootstrap - #2622

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-2621-wp-codebox
Dec 3, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-2621-wp-codebox

Conversation

@chubes4

@chubes4 chubes4 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Project mode now loads the explicit Composer autoloader before the configured bootstrap, matching PHPUnit’s CLI. With real PHPUnit 11, the same fixture failed on main at project_bootstrap because PHPUnit\Runner\Version was missing; with this change, the recipe completed successfully.

What changed

  • Load project-autoload-file before the bootstrap in the shared project runner, including multisite; the separate core runner already loads its autoloader first.
  • Keep the legacy autoload-file fallback after bootstrap and preserve the project_autoload stage markers and PROJECT_AUTOLOAD: log.
  • Update command help and extend the PHPUnit 11 integration fixture to exercise a bootstrap that uses PHPUnit without requiring the Composer autoloader itself.

Verification

All gates passed on 4a8016c. Base main@195b270 unchanged.

  • HOMEBOY_LINT_BASE=195b270641500cdc32a168154f305d977d973512 homeboy --placement local review lint wp-codebox --path . --…: passed, 81225 ms; retained gate metadata.
  • npm run build: passed, 490 ms; retained gate metadata.
  • npx tsx --test tests/phpunit-discovery-only.test.ts tests/phpunit-project-autoload.test.ts: passed, 2235 ms; retained gate metadata.
  • repro: none (no repro gate was declared, so these gates do not prove the issue).
  • CI: pending

Cook run
  • Cook ID: agent-task-e7750f8a-2ae8-4b56-9b53-fcac61ef8cf1
  • Attempt run ID: agent-task-e7750f8a-2ae8-4b56-9b53-fcac61ef8cf1-attempt-1-46c3a2a1
  • Gate 1: tree 7eaf667430ae937e9d5d3f19978754c93dbf10d4
  • Gate 2: tree 7eaf667430ae937e9d5d3f19978754c93dbf10d4
  • Gate 3: tree 7eaf667430ae937e9d5d3f19978754c93dbf10d4

Evidence

  • The focused project-autoload test and runtime package compilation passed locally. Homeboy owns the declared verification gates.
  • The local integration run reproduced the missing-class error using the unchanged runner, then passed with the fix and no skips. It verified that project autoload completed before bootstrap began and that the passing recipe ran exactly one test.

AI disclosure

Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served gpt-6.2-sol. Cook time: 43m19s.

AI traced the runner variants, implemented the ordering fix, and verified the regression with Composer-installed PHPUnit, under the direction of the Cook requester. Homeboy reports controller verification separately from this account of the AI's work. A human reviews before merge.

Refs #2621

@chubes4
chubes4 marked this pull request as ready for review December 3, 2026 00:54
@chubes4
chubes4 merged commit c8b0479 into main Dec 3, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant