Skip to content

test: add unit test harness and initial tests#1

Merged
rbcorrales merged 6 commits into
mainfrom
test/unit-test-harness
May 18, 2026
Merged

test: add unit test harness and initial tests#1
rbcorrales merged 6 commits into
mainfrom
test/unit-test-harness

Conversation

@rbcorrales
Copy link
Copy Markdown
Owner

Summary

  1. Adds PHPUnit coverage for related articles block rendering and search argument mapping.
  2. Adds a Node unit test for the i18n source map generator.
  3. Wires bun run test into CI and release workflows.

Testing

  1. composer validate --strict
  2. bun run lint
  3. bun run test
  4. composer analyze
  5. bun run build

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 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 test integration 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.

Comment thread tests/php/bootstrap.php Outdated
Comment thread tests/php/Unit/RelatedArticlesBlockTest.php
Comment thread phpcs.xml Outdated
Comment thread package.json Outdated
rbcorrales and others added 3 commits May 18, 2026 12:00
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
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

Copilot reviewed 13 out of 15 changed files in this pull request and generated 5 comments.

Comment thread tests/php/bootstrap.php Outdated
Comment thread scripts/generate-i18n-source-map.test.js Outdated
Comment thread tests/php/Unit/RelatedArticlesBlockTest.php
Comment thread package.json
Comment thread scripts/generate-i18n-source-map.mjs Outdated
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

Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.

Comment thread package.json
Co-authored-by: Codex <noreply@openai.com>
@rbcorrales rbcorrales merged commit e6810b1 into main May 18, 2026
2 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