Skip to content

test: add test workflow support and initial tests#1

Merged
rbcorrales merged 1 commit into
mainfrom
ci/unit-test-workflow
May 18, 2026
Merged

test: add test workflow support and initial tests#1
rbcorrales merged 1 commit into
mainfrom
ci/unit-test-workflow

Conversation

@rbcorrales
Copy link
Copy Markdown
Owner

Summary

  1. Adds PHPUnit coverage for the shared version bump helper.
  2. Adds a reusable test-command input to CI and release workflows.
  3. Tightens release zip verification for test and development artifacts.

Testing

  1. composer validate --strict
  2. composer lint
  3. composer test

Co-authored-by: Codex <noreply@openai.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.php to expose bump_plugin_version() as library-callable (entrypoint guard + CLI wrapper) and add PHPUnit + tests/bootstrap covering bump, prerelease rejection, and ambiguous-header failure.
  • Add test-command input to plugin-ci.yml and plugin-release.yml, run composer test in repo's own ci.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 -qE one-liners to explicit while/exit 1 loops; 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.

@rbcorrales rbcorrales merged commit 529e97b into main May 18, 2026
6 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.

2 participants