Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wordpress.phpunit recipes can now declare theme dependencies.
recipe build phpunitandbuildWordPressPhpunitRecipeacceptextra_themesand write them into the recipe asinputs.extra_themesplus adependency-themes-jsonstep arg. The existing generic recipe path mounts those themes. The managed PHPUnit bootstrap now makes theactivate: truetheme the active theme for the test site and loads its functions.php before fixtures and tests. If a theme is passed inextra_pluginsby mistake, validation now says it looks like a theme and points toextra_themes. Both new test files pass locally. The integration test boots Playground and a component PHPUnit test that calls a theme helper passes (1 test, 4 assertions).What changed
extra_themesand pass them tobuildWordPressPhpunitRecipe.extra_themesis checked (needs a source, at most one active theme, unique slugs), emitted asinputs.extra_themes, and turned into thedependency-themes-jsonarg. New exported helperphpunitDependencyThemes. Slugs are resolved the same way the CLI does it (mountSlug, then slug, then the local source folder name).dependency-themes-jsonis parsed by the newparsePhpunitDependencyThemes. A newload_theme_depsstage runs after dependency plugins and theirplugins_loadedcallbacks, beforeinitis replayed. It checks the themes are mounted under wp-content/themes, sets thetemplate/stylesheetoptions (child plus parent), loads functions.php (child first, then parent, matching WordPress) and runs any newafter_setup_themecallbacks. This stage is needed because the wp-phpunit install runs with WP_INSTALLING set, so WordPress never loads theme functions during the managed bootstrap.extra_pluginssource has no plugin entry file but has a style.css withTheme Name:, themissing-path ...pluginFileissue now says the source looks like a theme and to useextra_themes. The message for an ordinary missing file is unchanged.php -lcheck of the generated bootstrap. It also runs the generated theme stage in host PHP against real child and parent theme folders with minimal WordPress stubs, and checks that a missing mount fails clearly.get_stylesheet()and checks thatafter_setup_themefired. It is added to the serial list in scripts/smoke-discovery.ts.extra_themesoption and the bootstrap behaviour.Verification
1-verify-file-18b8693431fb61faaaf9c0d6c4e8e95fabc519f81dac821f749784e80b59643b.txt (
npm run build && npx tsx tests/phpunit-extra-themes.test.ts): passed on3f3632f. Basemain@85ccba4unchanged. 6694 ms; retained gate metadata.HOMEBOY_LINT_BASE=85ccba40b5b36873c79468bb65affea45ce1a975 homeboy --placement l (
HOMEBOY_LINT_BASE=85ccba40b5b36873c79468bb65affea45ce1a975 homeboy --placement local review lint wp-codebox --path . --…): passed on3f3632f. Basemain@85ccba4unchanged. 72095 ms; retained gate metadata.repro: none (no repro gate was declared, so these gates do not prove the issue).
CI: pending
Cook run
agent-task-78ab7652-90fa-4e78-acab-af0506fbbfa8agent-task-78ab7652-90fa-4e78-acab-af0506fbbfa8-attempt-1-445c67910fa6f1801f25ea2b5bbbfe356f52a2e665525f8a0fa6f1801f25ea2b5bbbfe356f52a2e665525f8aDelivery
Evidence
npx tsx tests/phpunit-extra-themes.integration.test.tsboots Playground with the theme declared through extra_themes. The plugin's test calls consumer_theme_helper(), checks get_stylesheet() === 'consumer-theme' and checks that after_setup_theme fired. PHPUnit reports 'OK (1 test, 4 assertions)'.AI disclosure
Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served claude-opus-5-5. Cook time: 25m47s.
Implementation and reviewer documentation were written by the AI, under the direction of the Cook requester. Gates were run by Homeboy. A human reviews before merge.
Refs #2604