mirror of
https://gh.wpcy.net/https://github.com/elementor/elementor.git
synced 2026-06-18 04:33:19 +08:00
## PR Checklist <!-- Please check if your PR fulfills the following requirements: **Filling out the template is required.** Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion. --> - [ ] The commit message follows our guidelines: https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x" with no spaces eg: [x]. --> - [ ] Bugfix - [ ] Feature - [ ] Code style update (formatting, local variables) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] CI related changes - [ ] Documentation content changes - [ ] Other... Please describe: ## Summary This PR can be summarized in the following changelog entry: * ## Description An explanation of what is done in this PR * ## Test instructions This PR can be tested by following these steps: * ## Quality assurance - [ ] I have tested this code to the best of my abilities - [ ] I have added unittests to verify the code works as intended - [ ] Docs have been added / updated (for bug fixes / features) Fixes # <!--start_gitstream_placeholder--> ### ✨ PR Description ## 1. Problem & Context Developers running PHPUnit locally need a streamlined setup that handles MySQL container orchestration, WordPress test suite installation, and test execution without manual dependency management. ## 2. What Changed (Where) - **bin/phpunit-local.sh** — New 122-line bash script automating Docker MySQL setup, container lifecycle, WP test suite installation, and PHPUnit execution with optional test filtering - **composer.json** — Added `phpunit:local` script alias pointing to the new bash runner - **docs/development/phpunit.md** — Replaced outdated manual setup instructions with Docker-based workflow documentation including version/filter examples - **bin/install-wp-tests.sh** — Added `SKIP_INSTALL_DB` flag to allow database recreation without reinstalling test suite ## 3. How It Works Entry point: `composer run phpunit:local [--filter]` → checks Docker/SVN availability → finds or creates MySQL container on port 3306 → waits for MySQL readiness → cleans/reinstalls WP test suite via existing `install-wp-tests.sh` (skipping DB init if `SKIP_INSTALL_DB` set) → executes PHPUnit with optional filter or full test run. Architecture-independent MySQL image selection (mysql:8.4 for arm64, 8.0 for others) handles Silicon Mac compatibility. ## 4. Risks **Container port collision:** Script reuses any container on port 3306 regardless of credentials—could silently use wrong database if unrelated containers exist. Mitigation: explicit error messaging if pings fail with credential hints. **SVN requirement undocumented for Windows WSL users:** script only provides Mac/Linux install hints. _Generated by LinearB AI and added by gitStream._ <sub>AI-generated content may contain inaccuracies. Please verify before using. 💡 **Tip:** You can customize your AI Description using **Guidelines** [Learn how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub> <!--end_gitstream_placeholder--> --------- Co-authored-by: ElementorBot <48412871+elementorbot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| bootstrap-env.sh | ||
| includes.sh | ||
| install-wp-tests-local.sh | ||
| install-wp-tests.sh | ||
| phpunit-local.sh | ||
| uninstall.sh | ||