Commit f6b0feb413d for woocommerce
commit f6b0feb413dc0f130525e1fc8fc1faeaeb2154a5
Author: iris-woocommerce[bot] <282076412+iris-woocommerce[bot]@users.noreply.github.com>
Date: Tue Nov 17 01:03:24 2026 +0100
Fix FulfillmentsImporterRestControllerTest mocked-upload test under the shared REST server (#71026)
Use a fresh REST server per test in FulfillmentsImporterRestControllerTest
The shared per-class REST server keeps routes bound to the first controller
that registered them, so the test registering a controller with a mocked
upload helper was served by the real helper and got a 400.
Co-authored-by: lucatume <luca.tumedei@automattic.com>
Co-authored-by: matticbot <matticbot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/changelog/fix-fulfillments-importer-rest-test-shared-server b/plugins/woocommerce/changelog/fix-fulfillments-importer-rest-test-shared-server
new file mode 100644
index 00000000000..c66baeb989f
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-fulfillments-importer-rest-test-shared-server
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Fix a fulfillments importer REST test broken by the shared per-class REST server; no production change.
+
diff --git a/plugins/woocommerce/tests/php/src/Admin/Features/Fulfillments/Importer/FulfillmentsImporterRestControllerTest.php b/plugins/woocommerce/tests/php/src/Admin/Features/Fulfillments/Importer/FulfillmentsImporterRestControllerTest.php
index 3dd735aaf2a..70d1786c148 100644
--- a/plugins/woocommerce/tests/php/src/Admin/Features/Fulfillments/Importer/FulfillmentsImporterRestControllerTest.php
+++ b/plugins/woocommerce/tests/php/src/Admin/Features/Fulfillments/Importer/FulfillmentsImporterRestControllerTest.php
@@ -15,6 +15,13 @@ use WP_REST_Request;
*/
class FulfillmentsImporterRestControllerTest extends WC_REST_Unit_Test_Case {
+ /**
+ * Use a fresh REST server per test, since some tests register a controller with a mocked upload helper.
+ *
+ * @var bool
+ */
+ protected static $reuse_rest_server = false;
+
/**
* Original fulfillments feature flag value.
*