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

This commit is contained in:
Vladimir Bryzgalov
2026-05-16 19:22:59 +05:00
parent d724089b2d
commit b967a3a59f
2 changed files with 30 additions and 0 deletions
+20
View File
@@ -311,4 +311,24 @@ final class HelpersTest extends TestCase
self::assertTrue(true);
}
public function test_index_town_alt_page_id_returns_int_when_option_set(): void
{
\Brain\Monkey\Functions\expect('get_field')
->once()
->with('index_town_alt', 'option')
->andReturn(42);
self::assertSame(42, Helpers::index_town_alt_page_id());
}
public function test_index_town_alt_page_id_returns_null_when_zero(): void
{
\Brain\Monkey\Functions\expect('get_field')
->once()
->with('index_town_alt', 'option')
->andReturn(0);
self::assertNull(Helpers::index_town_alt_page_id());
}
}