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.
This commit is contained in:
Vladimir Bryzgalov
2026-05-16 19:54:23 +05:00
parent 79de284f53
commit fc21fd1f06
4 changed files with 237 additions and 2 deletions
+9 -1
View File
@@ -33,7 +33,15 @@ abstract class TestCase extends BaseTestCase
$GLOBALS['wp_the_query'],
$GLOBALS['post']
);
Monkey\tearDown();
try {
Monkey\tearDown();
} finally {
// Patchwork routes MUST be disconnected even when Monkey\tearDown() throws
// (e.g. Mockery count validation failure). If they are not, any
// when('function_exists')->alias() from the failed test stays active and
// causes "Cannot redeclare function __()..." in the next test's setUp().
\Patchwork\restoreAll();
}
parent::tearDown();
}
}