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'); +} + +