Commit Graph

42 Commits

Author SHA1 Message Date
Vladimir Bryzgalov 004a8517e4 feat(wpmc S4): Router::route internal page + page_unic swap 2026-05-16 19:59:00 +05:00
Vladimir Bryzgalov 98e16fce7c test(wpmc S4): Router root URL index_town_alt fallback + no-data behaviors 2026-05-16 19:58:21 +05:00
Vladimir Bryzgalov 9af4c2976e feat(wpmc S4): Router::route root URL uses main_page_alt term meta 2026-05-16 19:58:04 +05:00
Vladimir Bryzgalov b218f5588b test(wpmc S4): Router::route skip-condition invariants 2026-05-16 19:57:28 +05:00
Vladimir Bryzgalov d30a039a73 feat(wpmc S4): Router scaffold + query_vars filter for town 2026-05-16 19:57:12 +05:00
Vladimir Bryzgalov fc21fd1f06 feat(wpmc S4): OptionsPage::do_register registers routing field group
Also: add acf_add_options_page to acf-stubs.php; add translation-function
stubs to acf-stubs.php; fix TestCase::tearDown to call Patchwork::restoreAll()
in a finally block so that when('function_exists') routes are always cleaned up
even when Mockery::close() throws InvalidCountException.
2026-05-16 19:54:23 +05:00
Vladimir Bryzgalov 79de284f53 feat(wpmc S4): OptionsPage scaffold + main_town_slug filter wiring 2026-05-16 19:39:18 +05:00
Vladimir Bryzgalov 11bfaa08a0 test(wpmc S4): restore ACF-missing guard assertions + tighten stub signature
Re-add ->never() to both noop tests so Brain Monkey/Mockery actively asserts
acf_add_local_field_group is never called when ACF is absent.  Order matters:
expect() must precede when('function_exists')->alias() so FunctionStub sees the
real function_exists and skips the eval() path (function already declared in
acf-stubs.php).  Also tighten stub signature to match real ACF ($field_group,
no type hint, no default).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:37:30 +05:00
Vladimir Bryzgalov 494061e39f feat(wpmc S4): TermMeta registers ACF main_page_alt on taxonomy town
Add acf-stubs.php + TestCase::setUp() require-after-Patchwork pattern so
acf_add_local_field_group is Patchwork-instrumented and re-interceptable
across FieldGroupTest and TermMetaTest in the same PHP process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:33:39 +05:00
Vladimir Bryzgalov b967a3a59f feat(wpmc S4): Helpers::index_town_alt_page_id reads ACF option 2026-05-16 19:22:59 +05:00
Vladimir Bryzgalov d724089b2d feat(wpmc S4): Helpers::page_unic_swap with per-request cache 2026-05-16 19:22:37 +05:00
Vladimir Bryzgalov d122bfacb5 feat(wpmc S4): Helpers::is_routable_path with page_no_rep exclusions 2026-05-16 19:22:01 +05:00
Vladimir Bryzgalov f4184a7777 feat(wpmc S4): Helpers::main_town_slug reads ACF option 2026-05-16 19:21:31 +05:00
Vladimir Bryzgalov 0565357b5e test(wpmc S4): WP_Query stub + wp_query globals cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:20:00 +05:00
Vladimir Bryzgalov 259470ca63 refactor(wpmc S3): get_terms modern signature + REQUEST_URI cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:17:08 +05:00
Vladimir Bryzgalov d8b0d01f1c feat(wpmc S3): procedural wpmc_* API + smoke test
Also fixes PluginBootTest to be order-independent (reset booted flag)
and to expect ShortcodeDmr hook that boot() now wires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:11:47 +05:00
Vladimir Bryzgalov 3dbca34234 feat(wpmc S3): Plugin::boot() wires ShortcodeDmr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:10:42 +05:00
Vladimir Bryzgalov adbbd205a1 test(wpmc S3): lock per-request render cache for ShortcodeDmr 2026-05-12 20:07:30 +05:00
Vladimir Bryzgalov 9cacf18725 test(wpmc S3): ShortcodeDmr::render edge-case coverage 2026-05-12 20:07:18 +05:00
Vladimir Bryzgalov 0be1a5a08f feat(wpmc S3): ShortcodeDmr::render resolves text by current town 2026-05-12 20:07:01 +05:00
Vladimir Bryzgalov 464d254f1c test(wpmc S3): lock add_shortcode call in ShortcodeDmr::do_register 2026-05-12 20:06:07 +05:00
Vladimir Bryzgalov f68b30b4e6 feat(wpmc S3): ShortcodeDmr scaffold + register init hook 2026-05-12 20:05:50 +05:00
Vladimir Bryzgalov 22099cf1d6 feat(wpmc S3): Helpers::remove_domain_link via parse_url
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:04:10 +05:00
Vladimir Bryzgalov 11bd3a06b0 feat(wpmc S3): Helpers::alt_get_field with do_shortcode + filter
Implements alt_get_field(): applies wpmc_alt_get_field_post_id filter for
post_id remapping, guards against missing ACF, runs do_shortcode on string
results, passes arrays/null through unchanged.  4 new tests; full suite
22 tests / 58 assertions green.

Note: Brain Monkey FunctionStub::__construct calls function_exists()
internally; expect() calls must precede when('function_exists')->alias()
in each test to avoid the alias intercepting the stub-creation check and
causing eval redeclaration errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:02:57 +05:00
Vladimir Bryzgalov 1f343dfaf2 test(wpmc S3): current_town fallback + filter + memoization coverage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:58:42 +05:00
Vladimir Bryzgalov f81cefefbe feat(wpmc S3): Helpers::current_town URI-match path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:58:19 +05:00
Vladimir Bryzgalov 58838b0c19 feat(wpmc S3): Helpers::get_term_by_slug with per-request cache
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:56:54 +05:00
Vladimir Bryzgalov 176d8e0c0b feat(wpmc S3): Helpers scaffold + reset_cache wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:55:09 +05:00
Vladimir Bryzgalov 38bb7dae55 feat(wpmc S2): make Plugin::boot() idempotent
Add private \$booted flag; guard skips all re-registration on subsequent
calls. TDD: RED (3x boot -> expectAdded->once() fails) then GREEN.
Drop deprecated setAccessible() call (no-op since PHP 8.1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:01:43 +05:00
Vladimir Bryzgalov e2399e2360 feat(wpmc S2): Plugin::boot() wires Taxonomy + PostType + FieldGroup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:53:58 +05:00
Vladimir Bryzgalov f859385761 chore(wpmc S2): pin patchwork cache + tighten noop test guard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:52:34 +05:00
Vladimir Bryzgalov 519e436337 feat(wpmc S2): register ACF group list_shortcode for shortcode-town
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:47:57 +05:00
Vladimir Bryzgalov ded71e8fd0 test(wpmc S2): lock ACF-missing guard for FieldGroup
Add patchwork.json to enable function_exists shimming via Patchwork
(required so Brain Monkey can intercept the PHP internal).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:47:09 +05:00
Vladimir Bryzgalov 551f107344 feat(wpmc S2): FieldGroup::register() attaches acf/init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:45:51 +05:00
Vladimir Bryzgalov 054439aade test(wpmc S2): assert query_var=false in PostType test for parity 2026-05-12 17:44:31 +05:00
Vladimir Bryzgalov f95d09cc89 feat(wpmc S2): register CPT shortcode-town with required args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:36 +05:00
Vladimir Bryzgalov e0b87dde0c feat(wpmc S2): PostType::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:06 +05:00
Vladimir Bryzgalov cb9cbddce3 chore(wpmc S2): remove unused Brain\Monkey\Actions import 2026-05-12 17:40:58 +05:00
Vladimir Bryzgalov b06ea9e605 feat(wpmc S2): register taxonomy town with required args
Also stub translation functions in base TestCase so __() calls from
WPMultiCity namespace resolve correctly via Brain Monkey.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:37:29 +05:00
Vladimir Bryzgalov 53a784bbe8 feat(wpmc S2): Taxonomy::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:36:26 +05:00
Vladimir Bryzgalov 945ae898ac fix(wpmc S2): drop redundant Mockery::close from TestCase teardown
Brain\Monkey\tearDown() already calls Mockery::close internally;
calling it explicitly duplicates the close.
2026-05-12 17:34:47 +05:00
Vladimir Bryzgalov d98499dbb2 test(wpmc S2): setup PHPUnit + Brain Monkey + Mockery 2026-05-12 17:31:53 +05:00