Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Dec 31, 2025

What

Part of #315.

Adds PHPUnit test coverage for all SCF field type classes.

Why

Field type classes are the core of SCF - they handle data validation, formatting, storage, and REST API integration.

How

Adding 578 tests across 37 field type classes using a shared abstract base:

Category Field Types Test Count
Basic text, textarea, number, range, email, url, password ~70
Content wysiwyg, oembed, image, file, gallery ~60
Choice select, checkbox, radio, button_group, true_false ~80
Relational link, post_object, page_link, relationship, taxonomy, user ~90
Layout message, accordion, tab, group, repeater, flexible_content ~120
Special date_picker, time_picker, date_time_picker, color_picker, icon_picker, google_map, nav_menu, clone ~90

Testing Instructions

Run the test suite:

./vendor/bin/phpunit --filter "Test_ACF_Field"

@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.

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.53%. Comparing base (abd5500) to head (460053d).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #336      +/-   ##
============================================
+ Coverage     29.16%   30.53%   +1.37%     
  Complexity     4410     4410              
============================================
  Files           291      291              
  Lines         36916    36918       +2     
============================================
+ Hits          10767    11274     +507     
+ Misses        26149    25644     -505     
Flag Coverage Δ
e2e 42.91% <ø> (+1.32%) ⬆️
javascript 6.53% <ø> (ø)
phpunit 28.70% <ø> (+3.72%) ⬆️

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 changed the title Tests: Add PHPUnit tests for field type classes with abstract base Tests: Add PHPUnit tests for field type classes Dec 31, 2025
@priethor priethor force-pushed the 71ae-phase-2-pr-12-b branch from 7eebe2c to 5b1e950 Compare December 31, 2025 12:12
@priethor priethor mentioned this pull request Dec 31, 2025
22 tasks
@priethor priethor force-pushed the 71ae-phase-2-pr-12-b branch 9 times, most recently from 2ede044 to a840671 Compare December 31, 2025 17:22
@priethor priethor force-pushed the 71ae-phase-2-pr-12-b branch from a840671 to 460053d Compare December 31, 2025 17:41
@priethor priethor merged commit 7551a70 into trunk Dec 31, 2025
9 checks passed
@priethor priethor self-assigned this Dec 31, 2025
@priethor priethor added this to the 6.9.0 milestone Dec 31, 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