test: stub wp_parse_url() in PHPUnit bootstrap
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
This commit is contained in:
@@ -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 ───────────────────────────────────────────────.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user