Skip to content

Improve Autodescription (TSF) integration coverage - #20

Merged
nlemoine merged 1 commit into
mainfrom
test/autodescription-coverage
Jun 3, 2026
Merged

Improve Autodescription (TSF) integration coverage#20
nlemoine merged 1 commit into
mainfrom
test/autodescription-coverage

Conversation

@nlemoine

@nlemoine nlemoine commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Raises The SEO Framework (Autodescription) integration coverage from ~67% to 94%.

The new tests call the public filter methods directly with plain args (no HTTP request / TSF memoization), so they're fast and deterministic.

Coverage

  • Autodescription.php (0% → 100%) — composite isSupported() / registerHooks() boot.
  • QueryType.php (40% → 100%) — markPfcptAsSingularArchive: the already-a-singular-archive short-circuit, and the explicit-id resolution path.
  • Breadcrumbs.php (78% → 92.5%) — addPfcptPageCrumb argument-resolution guards: non-int/non-WP_Post id, missing post, non-string taxonomy, unknown taxonomy, a real taxonomy with no PFCPT-bound post type, and the no-match fall-through.

The 5 remaining Breadcrumbs lines are defensive guards in the query-based resolution path (get_post_type() returning non-string, queried object not a WP_Term, etc.) that can't be reached without a malformed query state.

Checks

11 → 16 tests pass; phpcs clean. No src/ changes.

…b guards

Exercises the public integration methods directly: the Autodescription composite isSupported()/registerHooks() (0% -> 100%); QueryType::markPfcptAsSingularArchive — the already-archive short-circuit and explicit-id resolution (40% -> 100%); and Breadcrumbs::addPfcptPageCrumb argument-resolution guards (78% -> 92.5%).
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (7e45b27) to head (4297a59).

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #20      +/-   ##
============================================
+ Coverage     90.34%   91.86%   +1.52%     
  Complexity      485      485              
============================================
  Files            31       31              
  Lines          1315     1315              
============================================
+ Hits           1188     1208      +20     
+ Misses          127      107      -20     

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

@nlemoine
nlemoine merged commit 3a8c8a9 into main Jun 3, 2026
33 checks passed
@nlemoine
nlemoine deleted the test/autodescription-coverage branch June 3, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants