feat(wpmc S4): Helpers::main_town_slug reads ACF option

This commit is contained in:
Vladimir Bryzgalov
2026-05-16 19:21:31 +05:00
parent 0565357b5e
commit f4184a7777
2 changed files with 32 additions and 0 deletions
+20
View File
@@ -211,4 +211,24 @@ final class HelpersTest extends TestCase
// remove_domain_link is pure (no WP function dependencies) — exercise the proxy.
self::assertSame('/foo/', wpmc_remove_domain_link('https://site.com/foo/'));
}
public function test_main_town_slug_reads_option_via_acf(): void
{
\Brain\Monkey\Functions\expect('get_field')
->once()
->with('main_town_slug', 'option')
->andReturn('spb');
self::assertSame('spb', Helpers::main_town_slug());
}
public function test_main_town_slug_returns_null_when_option_empty(): void
{
\Brain\Monkey\Functions\expect('get_field')
->once()
->with('main_town_slug', 'option')
->andReturn(false);
self::assertNull(Helpers::main_town_slug());
}
}