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:
+9
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user