Skip to content

Refactor test infrastructure#556

Merged
pfefferle merged 10 commits intomainfrom
refactor/test-infrastructure
Dec 11, 2025
Merged

Refactor test infrastructure#556
pfefferle merged 10 commits intomainfrom
refactor/test-infrastructure

Conversation

@pfefferle
Copy link
Copy Markdown
Owner

@pfefferle pfefferle commented Dec 11, 2025

Summary

This PR modernizes the test and CI infrastructure.

Changes

Composer & Dependencies:

  • Updated PHPUnit to ^9 || ^10
  • Updated yoast/phpunit-polyfills to ^4.0
  • Added sirbrillig/phpcs-variable-analysis and phpcsstandards/phpcsextra
  • Added lint:fix and test:wp-env scripts

PHPCS Configuration:

  • Added parallel processing (50 threads)
  • Added VariableAnalysis rule
  • Updated minimum WP version to 6.5
  • Improved exclude patterns

PHPUnit Configuration:

  • Updated to PHPUnit 10 schema
  • Reorganized test directory to tests/phpunit/
  • Changed test file prefix to class-test-

GitHub Actions:

  • Updated all actions to latest versions (checkout@v6, composer-install@v3, stale@v9)
  • Added path filters to workflows for selective triggering
  • Renamed wp-phpunit.yml to phpunit.yml
  • Added coverage job with Codecov integration
  • Added checkstyle reporting for PR annotations

Local Development:

  • Replaced grunt with wp-env
  • Added .wp-env.json configuration
  • Added npm scripts: env:start, env:stop, env:destroy, env:test

Test plan

  • Run npm install && npm run env:start to start local environment
  • Run npm run env:test to execute PHPUnit tests
  • Verify GitHub Actions workflows run correctly on PR

- Update composer.json with modern dev dependencies
- Update phpcs.xml with parallel processing and VariableAnalysis
- Update phpunit.xml.dist for PHPUnit 10 compatibility
- Reorganize tests to tests/phpunit/ structure with class-test- prefix
- Update GitHub Actions workflows with path filters and latest actions
- Replace grunt with wp-env for local development
- Add .wp-env.json configuration
@pfefferle pfefferle requested a review from dshanske December 11, 2025 18:07
@pfefferle pfefferle self-assigned this Dec 11, 2025
@pfefferle pfefferle changed the title Refactor test infrastructure to match ActivityPub plugin Refactor test infrastructure Dec 11, 2025
This commit removes redundant blank lines and asterisks from docblocks, improves parameter alignment, and fixes minor formatting issues across several core files for consistency and readability. No functional changes were made.
Eliminated the unused $request parameter from the static get method in Receiver to clean up the function signature.
@pfefferle pfefferle merged commit c00cc27 into main Dec 11, 2025
9 checks passed
@pfefferle pfefferle deleted the refactor/test-infrastructure branch December 11, 2025 19:32
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.

1 participant