Skip to content

[pull] main from nlemoine:main - #7

Merged
pull[bot] merged 6 commits into
huubl:mainfrom
nlemoine:main
Jun 3, 2026
Merged

[pull] main from nlemoine:main#7
pull[bot] merged 6 commits into
huubl:mainfrom
nlemoine:main

Conversation

@pull

@pull pull Bot commented Jun 3, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

nlemoine added 6 commits June 3, 2026 11:38
Polylang 3.7+ requires src/api.php (which defines PLL() and the pll_* API) only from init_context(), and init() reaches init_context() only when it detects a context: admin, REST, or frontend-with-languages. Under PHPUnit there is no request context and languages are created per test (after Refresh_Database rolls them back), so init() saw an empty context, returned before loading the API, and PLL() stayed undefined. Every PolylangTest then skipped via markTestSkipped, leaving src/Integration/Polylang at 0% coverage.

Force a frontend context through the pll_context filter so init_context() runs and loads the API. The whole PolylangTest suite now executes (0 -> ~79% line coverage on the Polylang integration).
AdminScreenTest::setUp gated the wp-admin/includes/plugin.php include on function_exists('register_setting'), but register_setting is a core function (wp-includes/option.php) that is always defined, so the include never loaded. add_submenu_page() — which lives in that admin include — was then undefined on WP builds that don't load it independently, erroring testAddPostTypeSubmenusAddsSubmenus. Guard on add_submenu_page() instead.
…posite

Add tests for previously-uncovered Yoast integration logic: Indexables::configurePageDetection including the pre_option_show_on_front workaround that makes Yoast resolve PFCPT pages (31% -> 100%); Schema CollectionPage idempotency (58% -> 100%); the WordPressSeo composite boot/registerHooks (0% -> 100%); and a fixTaxonomyBreadcrumbs guard for a non-main taxonomy.
fixHomeBreadcrumbs only ran when Yoast's get_page_type() returned 'Home_Page' for a PFCPT page. That held in Yoast ~17 (when the logic was first written, late 2021), but Yoast has since moved is_static_posts_page() onto the $wp_query->is_posts_page flag -- which Handler always sets -- and checks it before the Home_Page branch. PFCPT pages now resolve to Static_Posts_Page, so the method is unreachable on every supported Yoast.

Verified against Yoast 25.9 and 27.7, with and without Polylang and with breadcrumbs-home set: all resolve to Static_Posts_Page.
…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%).
The deprecated global function shims are guarded by function_exists() checks that execute during Composer's files autoload -- before PHPUnit starts collecting coverage -- so those lines can never be covered. Wrap the back-compat block in @codeCoverageIgnore; the shim bodies are still exercised by PublicApiTest.

Also add a test for get_page_id_for_custom_post_type() called with no post type outside a PFCPT query (the query-var fallthrough). functions.php goes 78% -> 93%.
@pull pull Bot locked and limited conversation to collaborators Jun 3, 2026
@pull pull Bot added the ⤵️ pull label Jun 3, 2026
@pull
pull Bot merged commit e5dd1f5 into huubl:main Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant