From 382a7ede5dd244f299b5ec97c59d4e61cdbd6c4c Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Tue, 23 Jun 2026 04:44:37 +0000 Subject: [PATCH] test: stub wp_parse_url() in PHPUnit bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stubs test suite runs without WordPress, so wp_parse_url() is undefined when sanitize_url() calls it (introduced in the previous PHPCS style commit). Add a thin stub that delegates to native parse_url() — identical behaviour to the real WP function. Agent-Session: prcore-jsonld-phpcs-20260623 --- tests/bootstrap.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a620db1..5479ada 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -170,6 +170,11 @@ if ( ! function_exists( 'is_email' ) ) { return (bool) filter_var( $email, FILTER_VALIDATE_EMAIL ); } } +if ( ! function_exists( 'wp_parse_url' ) ) { + function wp_parse_url( string $url, int $component = -1 ) { + return parse_url( $url, $component ); + } +} // ── Option / cron stubs ───────────────────────────────────────────────.