From 4479bdfedd96249ede20889a250faa902be1017c Mon Sep 17 00:00:00 2001 From: shail-mehta Date: Sat, 31 Oct 2026 05:27:32 +0000 Subject: [PATCH] Tests: Cover rest_output_rsd(). Add unit tests for WP-API RSD element output and empty REST URL handling. See #65819. --- .../phpunit/tests/rest-api/restOutputRsd.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/phpunit/tests/rest-api/restOutputRsd.php diff --git a/tests/phpunit/tests/rest-api/restOutputRsd.php b/tests/phpunit/tests/rest-api/restOutputRsd.php new file mode 100644 index 0000000000000..6cecd7cb99789 --- /dev/null +++ b/tests/phpunit/tests/rest-api/restOutputRsd.php @@ -0,0 +1,33 @@ +expectOutputRegex( + '##' + ); + rest_output_rsd(); + } + + /** + * @ticket 65819 + */ + public function test_outputs_nothing_when_rest_url_is_empty() { + add_filter( 'rest_url', '__return_empty_string' ); + + $this->expectOutputString( '' ); + rest_output_rsd(); + } +}