diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 97a4152..3a2f501 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -92,3 +92,19 @@ if ( ! class_exists( 'WP_Query' ) ) { } } } + +// Stub WP text-processing functions used by image prompt builder. +if ( ! function_exists( 'wp_strip_all_tags' ) ) { + function wp_strip_all_tags( $string, $remove_breaks = false ) { + $string = strip_tags( $string ); + if ( $remove_breaks ) { + $string = preg_replace( '/[\r\n\t ]+/', ' ', $string ); + } + return trim( $string ); + } +} +if ( ! function_exists( 'sanitize_text_field' ) ) { + function sanitize_text_field( $str ) { + return trim( strip_tags( $str ) ); + } +}