test: add test workflow support and initial tests#1
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
Pull request overview
Adds PHPUnit-based testing infrastructure to the repository (initial unit tests for the version bump helper, bootstrap, config), threads a new test-command input through the reusable CI and release workflows, and rewrites the release-zip forbidden-content verification to use explicit loops with broader forbidden file/dir coverage.
Changes:
- Refactor
scripts/bump-plugin-version.phpto exposebump_plugin_version()as library-callable (entrypoint guard + CLI wrapper) and add PHPUnit + tests/bootstrap covering bump, prerelease rejection, and ambiguous-header failure. - Add
test-commandinput toplugin-ci.ymlandplugin-release.yml, runcomposer testin repo's ownci.yml, and document the new input in README/AGENTS. - Tighten release zip verification: expand forbidden entries (tests, scripts, stubs, dev configs, docs, caches) and switch from
! grep -qEone-liners to explicitwhile/exit 1loops; pin Composer platform PHP to 8.3.0 and update lockfile with PHPUnit 12 dep tree.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/bump-plugin-version.php | Split CLI bootstrapping from bump_plugin_version() so it can be required from tests without executing. |
| tests/Unit/BumpPluginVersionTest.php | New PHPUnit coverage for happy path, prerelease rejection, and ambiguous header. |
| tests/bootstrap.php | Requires the bump script for the test suite. |
| phpunit.xml.dist | PHPUnit 12 config pointing at tests/Unit. |
| composer.json / composer.lock | Add phpunit/phpunit ^12.0, composer test script, pin platform PHP 8.3.0. |
| .github/workflows/plugin-ci.yml | Add optional test-command input executed before build. |
| .github/workflows/plugin-release.yml | Add test-command input; rewrite forbidden-entry/src checks with explicit loops and a broader forbidden list. |
| .github/workflows/ci.yml | Run composer test after lint in repo CI. |
| README.md / AGENTS.md | Document test-command input and PHPUnit as a local check surface. |
| .gitignore | Ignore .phpunit.cache/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
test-commandinput to CI and release workflows.Testing
composer validate --strictcomposer lintcomposer test