Skip to content

Testing: Add PHPUnit tests for field group functions#317

Merged
priethor merged 2 commits intotrunkfrom
add/field-group-function-tests
Dec 29, 2025
Merged

Testing: Add PHPUnit tests for field group functions#317
priethor merged 2 commits intotrunkfrom
add/field-group-function-tests

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Dec 29, 2025

What

Part of #315.

Adds PHPUnit test coverage for SCF field group functions.

Why

Field groups are the core organizational unit in SCF. These functions handle CRUD operations, visibility rules, duplication, and import/export.

How

With the help of Claude, adding 66 tests covering:

  • Field group key validation
  • Field group validation and defaults
  • CRUD operations (get, update, delete, trash, untrash)
  • Collection operations and filtering
  • Visibility and location rule matching
  • Field group duplication
  • Active status management
  • Style generation for hide_on_screen
  • Import/export functionality
  • Settings tabs configuration
  • Cache and slug filter functions

Testing Instructions

Run the test suite: ./vendor/bin/phpunit --filter Test_ACF_Field_Group_Functions

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 14.17%. Comparing base (ab02e04) to head (48eeeeb).

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #317      +/-   ##
============================================
+ Coverage     13.55%   14.17%   +0.61%     
  Complexity     4404     4404              
============================================
  Files           291      291              
  Lines         36984    36984              
============================================
+ Hits           5014     5241     +227     
+ Misses        31970    31743     -227     
Flag Coverage Δ
e2e 28.87% <ø> (ø)
javascript 2.50% <ø> (ø)
phpunit 11.43% <ø> (+0.84%) ⬆️

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.

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

Add 66 tests covering field group CRUD operations, validation,
visibility, duplication, import/export, and utility functions.
@priethor priethor force-pushed the add/field-group-function-tests branch from 794c485 to 32ec44d Compare December 29, 2025 19:08
@priethor priethor mentioned this pull request Dec 29, 2025
22 tasks
@priethor priethor self-assigned this Dec 29, 2025
@priethor priethor added this to the 6.8.0 milestone Dec 29, 2025
@priethor priethor merged commit 5afb9f2 into trunk Dec 29, 2025
12 checks passed
@priethor priethor deleted the add/field-group-function-tests branch December 29, 2025 19:42
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.

1 participant