From 376827ea97f39f6df50f2f9294eb338ce45e3fe1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Nov 2026 14:53:09 +0800 Subject: [PATCH] test(account): stub do_action in the account settings harness The email-change flow fires jio_user_email_changed after a successful write, but the harness only shimmed add_action, so the run died on an undefined do_action() before reaching the assertions. Co-Authored-By: Claude Fable 5 --- tests/widget-system/account-settings-harness.php | 5 +++++ 1 file changed, 5 insertions(+) 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); }