feat(wpmc S4): Helpers::main_town_slug reads ACF option
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user