🤖 AI-generated — created by an automated pipeline. Review before acting on this.
Context
PR #55 (issue #52) made src/Unit/bootstrap.php and src/Integration/bootstrap.php self-locating: when WPMEDIA_PHPUNIT_ROOT_DIR is not already defined, each bootstrap now require_onces src/BootstrapManager.php and calls BootstrapManager::setupConstants('unit'|'integration') to derive the two WPMEDIA_PHPUNIT_* constants. This is the exact code path that runs when PHPUnit re-executes the bootstrap standalone in an isolated @runInSeparateProcess child.
However, the package's own test suite cannot exercise this new branch because its bootstraps go through Tests/{Unit,Integration}/init-tests.php, which pre-defines the constants first. This means the self-derivation branch is validated today only by manual smoke testing, not by CI. A regression (e.g., a wrong relative path in the require_once, or a change to getRootDir()/setupConstants()) could silently break isolated-child consumers without any CI signal.
Dependencies
What needs to be done
Add a small CI smoke test script (e.g., a standalone PHP script or harness in a dedicated .github/workflows/ step) that:
- Does NOT pre-define
WPMEDIA_PHPUNIT_ROOT_DIR, WPMEDIA_PHPUNIT_ROOT_TEST_DIR, or WP_TESTS_DIR
- Requires the self-locating guard logic from
src/Unit/bootstrap.php (or src/Integration/bootstrap.php)
- Validates the self-derivation behavior
- Consider also testing a synthetic
vendor/wp-media/phpunit consumer layout to mirror the real isolated-child scenario
Acceptance Criteria
Additional information
This hardens the #52 behavior so it cannot silently regress. It is not a blocker but strongly improves confidence in the isolated-process bootstrap contract for downstream consumers.
Contributes to #30. Follow-up to #52 / PR #55.
Context
PR #55 (issue #52) made
src/Unit/bootstrap.phpandsrc/Integration/bootstrap.phpself-locating: whenWPMEDIA_PHPUNIT_ROOT_DIRis not already defined, each bootstrap nowrequire_oncessrc/BootstrapManager.phpand callsBootstrapManager::setupConstants('unit'|'integration')to derive the twoWPMEDIA_PHPUNIT_*constants. This is the exact code path that runs when PHPUnit re-executes the bootstrap standalone in an isolated@runInSeparateProcesschild.However, the package's own test suite cannot exercise this new branch because its bootstraps go through
Tests/{Unit,Integration}/init-tests.php, which pre-defines the constants first. This means the self-derivation branch is validated today only by manual smoke testing, not by CI. A regression (e.g., a wrong relative path in therequire_once, or a change togetRootDir()/setupConstants()) could silently break isolated-child consumers without any CI signal.Dependencies
What needs to be done
Add a small CI smoke test script (e.g., a standalone PHP script or harness in a dedicated
.github/workflows/step) that:WPMEDIA_PHPUNIT_ROOT_DIR,WPMEDIA_PHPUNIT_ROOT_TEST_DIR, orWP_TESTS_DIRsrc/Unit/bootstrap.php(orsrc/Integration/bootstrap.php)vendor/wp-media/phpunitconsumer layout to mirror the real isolated-child scenarioAcceptance Criteria
WPMEDIA_PHPUNIT_ROOT_DIRandWPMEDIA_PHPUNIT_ROOT_TEST_DIRare defined after bootstrap requireconvertWarningsToExceptions)Additional information
This hardens the #52 behavior so it cannot silently regress. It is not a blocker but strongly improves confidence in the isolated-process bootstrap contract for downstream consumers.
Contributes to #30. Follow-up to #52 / PR #55.