diff --git a/tests/widget-system/account-settings-harness.php b/tests/widget-system/account-settings-harness.php index 0f340316..a1af7d12 100644 --- a/tests/widget-system/account-settings-harness.php +++ b/tests/widget-system/account-settings-harness.php @@ -12,6 +12,7 @@ namespace { $GLOBALS['jio_account_meta'] = []; $GLOBALS['jio_account_transients'] = []; $GLOBALS['jio_account_actions'] = []; + $GLOBALS['jio_account_actions_fired'] = []; $GLOBALS['jio_account_mail'] = []; $GLOBALS['jio_account_existing_emails'] = []; $GLOBALS['jio_account_captcha_calls'] = []; @@ -45,6 +46,10 @@ namespace { function add_action(string $hook, callable $callback): void { $GLOBALS['jio_account_actions'][$hook] = $callback; } + /** jQuery-free stub: record fired hooks so tests can assert side effects. */ + function do_action(string $hook, mixed ...$args): void { + $GLOBALS['jio_account_actions_fired'][] = ['hook' => $hook, 'args' => $args]; + } function __(string $text, string $domain = ''): string { return $text; } function is_wp_error(mixed $value): bool { return $value instanceof WP_Error; } function is_email(string $email): bool { return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); }