From 75c484be5864c4b6087e9b4eb786b63757c0e6df Mon Sep 17 00:00:00 2001 From: gardenboi Date: Tue, 12 Dec 2023 20:34:01 +0100 Subject: [PATCH] should close #75 --- tests/PhpUnit/bootstrap.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/PhpUnit/bootstrap.php b/tests/PhpUnit/bootstrap.php index 617f885..d03db9a 100644 --- a/tests/PhpUnit/bootstrap.php +++ b/tests/PhpUnit/bootstrap.php @@ -75,3 +75,10 @@ function fail_if_died( $message ) { // Use existing behavior for wp_die during actual test execution. remove_filter( 'wp_die_handler', 'fail_if_died' ); + +// pre-load add_filter if it's not already loaded by PHPUnit +if (!function_exists('add_filter')) { + tests_add_filter('add_filter', 'fail_if_died'); +} + +