Skip to content

Conversation

@priethor
Copy link
Contributor

@priethor priethor commented Dec 30, 2025

What

Part of #314.

Adds PHPUnit test coverage for SCF post type and taxonomy functions in acf-post-type-functions.php and acf-taxonomy-functions.php.

Why

Post type and taxonomy functions are essential for managing custom post types and taxonomies created through SCF. They handle registration, CRUD operations, import/export, and status management.

How

Adding 87 tests covering:

  • Post type/taxonomy retrieval by ID and key
  • Raw data retrieval
  • Key validation (acf_is_post_type_key, acf_is_taxonomy_key)
  • Validation and translation functions
  • Collection retrieval with filtering
  • CRUD operations (create, read, update, delete)
  • Trash/untrash operations
  • Duplication with key remapping
  • Active status management
  • Edit link generation
  • Export/import operations
  • PHP code export for registration
  • Enter title placeholder export

Testing Instructions

Run the test suite:

./vendor/bin/phpunit --filter "Test_ACF_Post_Type_Functions|Test_ACF_Taxonomy_Functions"

@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 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 15.91%. Comparing base (675560c) to head (f8af317).
⚠️ Report is 7 commits behind head on trunk.

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #323      +/-   ##
============================================
+ Coverage     15.76%   15.91%   +0.15%     
  Complexity     4410     4410              
============================================
  Files           291      291              
  Lines         36997    36997              
============================================
+ Hits           5832     5888      +56     
+ Misses        31165    31109      -56     
Flag Coverage Δ
e2e 28.87% <ø> (ø)
javascript 2.50% <ø> (ø)
phpunit 13.82% <ø> (+0.20%) ⬆️

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 force-pushed the tests/post-type-taxonomy-functions branch from 65ba7e6 to f8af317 Compare December 30, 2025 11:39
@priethor priethor mentioned this pull request Dec 30, 2025
22 tasks
@priethor priethor merged commit 28eaad8 into trunk Dec 30, 2025
9 checks passed
@priethor priethor deleted the tests/post-type-taxonomy-functions branch December 30, 2025 11:45
@priethor priethor added this to the 6.8.0 milestone Dec 30, 2025
@priethor priethor self-assigned this Dec 30, 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