From c61b1433aa1f11ab87d6a5a1247d57ee95311312 Mon Sep 17 00:00:00 2001 From: Pollora maintainer Date: Mon, 23 Nov 2026 16:33:09 +0100 Subject: [PATCH] test(async): clear the WordPress filter registry after the tests that register the driver filter --- tests/Unit/Async/AsyncStaticsTest.php | 1 + tests/Unit/Async/AsyncTest.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/Unit/Async/AsyncStaticsTest.php b/tests/Unit/Async/AsyncStaticsTest.php index 01f8314..ff60ad4 100644 --- a/tests/Unit/Async/AsyncStaticsTest.php +++ b/tests/Unit/Async/AsyncStaticsTest.php @@ -21,6 +21,7 @@ }); afterEach(function (): void { + $GLOBALS['wp_filters'] = []; Async::flush(); }); diff --git a/tests/Unit/Async/AsyncTest.php b/tests/Unit/Async/AsyncTest.php index 1d646eb..991281e 100644 --- a/tests/Unit/Async/AsyncTest.php +++ b/tests/Unit/Async/AsyncTest.php @@ -100,6 +100,10 @@ public function dispatch(AsyncPayload $payload, int $delay = 0): void {} $GLOBALS['wp_filters'] = []; }); + afterEach(function (): void { + $GLOBALS['wp_filters'] = []; + }); + it('is wp-cron', function (): void { expect(Async::defaultDriver())->toBe('wp-cron'); });