test: add unit test harness and initial tests#1
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
Pull request overview
Adds an initial automated test harness for the WPVDB Blocks plugin, covering PHP rendering behavior for the related articles block and Node-based validation for the i18n source map generator, then wires the combined test command into documented checks and workflows.
Changes:
- Adds PHPUnit configuration, bootstrap stubs, and related articles block unit tests.
- Adds a Node test for
scripts/generate-i18n-source-map.mjs. - Adds
bun run testintegration across package scripts, CI/release workflows, and documentation.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yml |
Runs the new test command in CI. |
.github/workflows/release.yml |
Runs the new test command during release. |
.distignore |
Excludes test and PHPUnit artifacts from release bundles. |
.gitignore |
Ignores PHPUnit cache output. |
AGENTS.md |
Updates contributor guidance for the new tests. |
README.md |
Documents bun run test in local checks. |
composer.json |
Adds PHPUnit and a Composer test script. |
composer.lock |
Locks PHPUnit and transitive dev dependencies. |
package.json |
Adds the combined PHP and JS test command. |
phpcs.xml |
Excludes tests from PHPCS. |
phpunit.xml.dist |
Defines the PHPUnit test suite and bootstrap. |
tests/js/generate-i18n-source-map.test.mjs |
Adds Node coverage for source map generation and stale JSON cleanup. |
tests/php/Unit/RelatedArticlesBlockTest.php |
Adds rendering and search argument mapping tests. |
tests/php/bootstrap.php |
Adds WordPress/search stubs for PHP unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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
bun run testinto CI and release workflows.Testing
composer validate --strictbun run lintbun run testcomposer analyzebun run build