From 585e5d99c50a903df72c384342b36998f54bfef5 Mon Sep 17 00:00:00 2001 From: Shail Mehta Date: Sat, 10 Oct 2026 18:17:39 +0530 Subject: [PATCH] Tests: Assert matched route for edit site export OPTIONS checks. Strengthen the OPTIONS probes in update/delete negatives so a default 200 without a real route match would fail. Follow-up to #14115. See #66073. --- tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php b/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php index 6b11bbab29e2b..90c276f304190 100644 --- a/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php +++ b/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php @@ -176,6 +176,7 @@ public function test_update_item() { $response = rest_get_server()->dispatch( new WP_REST_Request( 'OPTIONS', $route ) ); $this->assertSame( 200, $response->get_status() ); + $this->assertSame( $route, $response->get_matched_route() ); foreach ( array( 'POST', 'PUT', 'PATCH' ) as $method ) { $request = new WP_REST_Request( $method, $route ); @@ -200,6 +201,7 @@ public function test_delete_item() { $response = rest_get_server()->dispatch( new WP_REST_Request( 'OPTIONS', $route ) ); $this->assertSame( 200, $response->get_status() ); + $this->assertSame( $route, $response->get_matched_route() ); $request = new WP_REST_Request( 'DELETE', $route ); $response = rest_get_server()->dispatch( $request );