Tests: Add PHPUnit tests for hook, WP, and bidirectional functions#325
Tests: Add PHPUnit tests for hook, WP, and bidirectional functions#325
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #325 +/- ##
============================================
+ Coverage 16.68% 20.32% +3.64%
Complexity 4410 4410
============================================
Files 291 291
Lines 36995 36940 -55
============================================
+ Hits 6173 7509 +1336
+ Misses 30822 29431 -1391
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
961b6a5 to
44c1a0d
Compare
44c1a0d to
3365f0f
Compare
Adds 109 PHPUnit tests covering three function files from includes/: - acf-hook-functions.php (28 tests): Filter/action variations registration and application, deprecated hook handling and backward compatibility - acf-wp-functions.php (53 tests): Object type resolution, post ID decoding, REST base resolution, and object ID extraction from various WordPress types - acf-bidirectional-functions.php (28 tests): Bidirectional relationship target types, choice building, value updates, and field settings rendering All tests use WorDBless for lightweight WordPress environment simulation and include data providers for comprehensive edge case coverage. Part of Phase 1 testing strategy implementation.
3365f0f to
8551a66
Compare
What
Part of #315.
Adds PHPUnit test coverage for hook, WordPress wrapper, and bidirectional functions.
Why
These functions handle critical WordPress hook management (filter/action variations, deprecated hook bridging), object type resolution, and bidirectional field relationships.
How
Adding 109 tests covering:
Testing Instructions
Run the test suite:
./vendor/bin/phpunit --filter "Test_ACF_Hook_Functions|Test_ACF_WP_Functions|Test_ACF_Bidirectional_Functions"