Commit 69f869e5e6e for woocommerce
commit 69f869e5e6eba153d723b87a9ec6a3e5e43ad07f
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Tue Nov 3 14:12:11 2026 +0200
Remove unused e2e-environment endpoint from the E2E test helper (#70557)
diff --git a/plugins/woocommerce/changelog/update-remove-e2e-environment-endpoint b/plugins/woocommerce/changelog/update-remove-e2e-environment-endpoint
new file mode 100644
index 00000000000..79de7525e8e
--- /dev/null
+++ b/plugins/woocommerce/changelog/update-remove-e2e-environment-endpoint
@@ -0,0 +1,3 @@
+Significance: patch
+Type: dev
+Comment: Remove the unused e2e-environment endpoint from the e2e test helper plugin; no production change.
diff --git a/plugins/woocommerce/tests/e2e/README.md b/plugins/woocommerce/tests/e2e/README.md
index bdb54acfc82..4394d6d4616 100644
--- a/plugins/woocommerce/tests/e2e/README.md
+++ b/plugins/woocommerce/tests/e2e/README.md
@@ -231,7 +231,7 @@ How a helper is wired up depends on when it needs to be active:
- `woocommerce-e2e-test-helper` — the general-purpose helper bundle, covering four concerns in one plugin:
- **Filter setter** — registers WordPress filters from an `e2e-filters` cookie so tests can override filtered values on the fly.
- **Process waiting actions** — runs the Action Scheduler queue synchronously when a request carries the `?process-waiting-actions` query param (used by the analytics suite so order data lands in reports immediately).
- - **Test helper REST API** — endpoints (`e2e-feature-flags`, `e2e-options`, `e2e-environment`, `e2e-theme`) for toggling feature flags, setting/deleting options, reading environment info and switching themes during a test.
+ - **Test helper REST API** — endpoints (`e2e-feature-flags`, `e2e-options`, `e2e-theme`) for toggling feature flags, setting/deleting options and switching themes during a test.
- **Timing overrides** — fixed filters removing production delays and throttles that only slow tests down or make them flaky: WordPress' comment flood protection, and the 1-minute wait before the first Back in Stock Notifications batch. Unconditional rather than cookie-driven, because they must also apply to REST requests made outside the browser.
- `wc-email-template-sync-test-helper` — see below (email template sync fixtures for RSM-146).
- **Per-test block plugins** live in `tests/e2e/test-plugins/blocks/`, mounted (not auto-activated) via the `woocommerce-blocks-test-plugins` mapping. They change store behavior, so they must not act for every test.
diff --git a/plugins/woocommerce/tests/e2e/test-plugins/woocommerce-e2e-test-helper/woocommerce-e2e-test-helper.php b/plugins/woocommerce/tests/e2e/test-plugins/woocommerce-e2e-test-helper/woocommerce-e2e-test-helper.php
index 0ef0b94b0eb..821eb8e31bc 100644
--- a/plugins/woocommerce/tests/e2e/test-plugins/woocommerce-e2e-test-helper/woocommerce-e2e-test-helper.php
+++ b/plugins/woocommerce/tests/e2e/test-plugins/woocommerce-e2e-test-helper/woocommerce-e2e-test-helper.php
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: WooCommerce E2E Test Helper
- * Description: Always-on utilities for the WooCommerce E2E suite: cookie-driven filter overrides, synchronous Action Scheduler processing, a REST API for feature flags, options, environment info and theme switching, and fixed overrides that remove production timing delays.
+ * Description: Always-on utilities for the WooCommerce E2E suite: cookie-driven filter overrides, synchronous Action Scheduler processing, a REST API for feature flags, options and theme switching, and fixed overrides that remove production timing delays.
* Version: 1.0.0
* Requires PHP: 7.4
* Author: WooCommerce
@@ -120,8 +120,7 @@ add_action(
* Test helper REST API
* -----------------------------------------------------------------------------
*
- * REST routes for toggling feature flags, setting/deleting options, reading environment info and
- * switching themes during a test.
+ * REST routes for toggling feature flags, setting/deleting options and switching themes during a test.
*/
/**
@@ -168,16 +167,6 @@ function register_helper_api() {
)
);
- register_rest_route(
- 'e2e-environment',
- '/info',
- array(
- 'methods' => 'GET',
- 'callback' => 'get_environment_info',
- 'permission_callback' => 'is_allowed',
- )
- );
-
register_rest_route(
'e2e-theme',
'/activate',
@@ -284,25 +273,6 @@ function is_allowed() {
return current_user_can( 'manage_options' );
}
-/**
- * Get environment info
- * @return WP_REST_Response
- */
-function get_environment_info() {
- $data['Core'] = get_bloginfo( 'version' );
- $data['PHP'] = sprintf( '%s.%s', PHP_MAJOR_VERSION, PHP_MINOR_VERSION );
-
- $all_plugins = get_plugins();
-
- foreach ( $all_plugins as $plugin_file => $plugin_data ) {
- if ( is_plugin_active( $plugin_file ) ) {
- $data[ $plugin_data['Name'] ] = $plugin_data['Version'];
- }
- }
-
- return new WP_REST_Response( $data, 200 );
-}
-
/**
* Activate a theme via the REST API.
* @param WP_REST_Request $request Request object.