Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Nov 28, 2025

What

Refactors JSON Schema tests to use an abstract base class.

Why

  • PostTypeSchemaTest and TaxonomySchemaTest had ~80 lines of duplicate test logic
  • Adding new schema tests (field groups, options pages) would require copying the same boilerplate

How

  • Created BaseSchemaTestCase abstract class with shared test methods
  • Moved schema tests to dedicated tests/php/schemas/ directory
  • Each schema test now only defines its specific data providers and configuration

Testing Instructions

  1. Run vendor/bin/phpunit tests/php/schemas/

@priethor priethor self-assigned this Nov 28, 2025
@priethor priethor changed the title JSON Schemas: Refactor PHPUnit tests JSON Schemas: Refactor PHPUnit tests to extract base class Nov 28, 2025
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7.96%. Comparing base (7cbfc3b) to head (5c0165a).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@           Coverage Diff           @@
##             trunk    #262   +/-   ##
=======================================
  Coverage     7.96%   7.96%           
  Complexity    4285    4285           
=======================================
  Files          265     265           
  Lines        33076   33076           
=======================================
  Hits          2635    2635           
  Misses       30441   30441           
Flag Coverage Δ
e2e 21.79% <ø> (ø)
phpunit 4.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@priethor priethor marked this pull request as ready for review November 28, 2025 16:16
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props priethor.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@priethor priethor merged commit 75fad26 into trunk Nov 28, 2025
10 checks passed
@priethor priethor deleted the refactor/schema-tests branch November 28, 2025 16:17
@priethor priethor added this to the 6.7.0 milestone Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants