Background
Following the Codecov rollout in #91 / #92, the wordpress-theme flag is currently at ~1% coverage. The theme PHPUnit <source> correctly includes both functions.php (~4900 lines) and includes/ (~80 lines), but only RelationshipHandlerTest.php exists — covering ~80 lines of includes/handlers/relationship.php. Everything in functions.php is uncovered.
This is the biggest single needle-mover for the project coverage number.
Suggested scope
Add Brain Monkey + Mockery tests for the REST endpoints currently registered in functions.php, using RelationshipHandlerTest.php as the pattern. In rough order of value (lines covered × user-facing impact):
Out of scope here
- ACF field-group registration (configuration, not branching logic)
- The
acf/init REST-meta bridging hook (covered indirectly by any write-path test)
- Admin sidebar menu structure (visual; testing it via Brain Monkey is high-effort, low-value)
Why now
The Codecov plumbing is in place but the theme number is misleading without more tests. Each REST endpoint test added moves the wordpress-theme flag by ~3-5% and exercises the most user-facing PHP in the repo.
Related
Background
Following the Codecov rollout in #91 / #92, the
wordpress-themeflag is currently at ~1% coverage. The theme PHPUnit<source>correctly includes bothfunctions.php(~4900 lines) andincludes/(~80 lines), but onlyRelationshipHandlerTest.phpexists — covering ~80 lines ofincludes/handlers/relationship.php. Everything infunctions.phpis uncovered.This is the biggest single needle-mover for the project coverage number.
Suggested scope
Add Brain Monkey + Mockery tests for the REST endpoints currently registered in
functions.php, usingRelationshipHandlerTest.phpas the pattern. In rough order of value (lines covered × user-facing impact):/cdcf/v1/team-member—cdcf_rest_create_team_member()(~180 lines). Cover happy path, the fourcouncilbranches (board / ecclesial / technical / academic), thecollab_post_idvalidation for academic_council, and the no-council "project-only member" branch./cdcf/v1/community-channel,/cdcf/v1/local-group,/cdcf/v1/academic-collaboration— all three follow the same translate-then-link-to-Community-page pattern. One helper test plus per-endpoint specifics./cdcf/v1/translate— OpenAI call should be mocked at the HTTP layer (Patchwork orwp_remote_poststub)./cdcf/v1/maintenance— Redis flag set/clear, capability check,duration_secondsclamping./cdcf/v1/update-disposable-domains— GitHub fetch mocked, file-write side effect stubbed.pre_get_postsfilter (added in feat(theme): group admin CPTs and polish admin UX #99).Out of scope here
acf/initREST-meta bridging hook (covered indirectly by any write-path test)Why now
The Codecov plumbing is in place but the theme number is misleading without more tests. Each REST endpoint test added moves the
wordpress-themeflag by ~3-5% and exercises the most user-facing PHP in the repo.Related
RelationshipHandlerTest.php