Commit 09ea2be548a for woocommerce
commit 09ea2be548a081d07b902df02a5c31d9836a57b7
Author: Jorge A. Torres <jorge.torres@automattic.com>
Date: Fri Aug 21 17:35:01 2026 +0100
Fix `WC_Install` test mixing up DB update keys and plugin version (#67927)
diff --git a/plugins/woocommerce/tests/php/includes/class-wc-install-test.php b/plugins/woocommerce/tests/php/includes/class-wc-install-test.php
index 9af04e0da8d..71c659f795d 100644
--- a/plugins/woocommerce/tests/php/includes/class-wc-install-test.php
+++ b/plugins/woocommerce/tests/php/includes/class-wc-install-test.php
@@ -314,11 +314,9 @@ class WC_Install_Test extends \WC_Unit_Test_Case {
* @testdox The version check schedules the automatic database update.
*/
public function test_version_check_schedules_db_auto_update(): void {
- $update_versions = array_keys( WC_Install::get_db_update_callbacks() );
- $from_version = $update_versions[ count( $update_versions ) - 2 ];
-
- update_option( 'woocommerce_db_version', $from_version );
- update_option( 'woocommerce_version', $from_version );
+ // Simulate version older than WC()->version is installed.
+ update_option( 'woocommerce_db_version', '9.4.0' );
+ update_option( 'woocommerce_version', '9.4.0' );
WC_Install::check_version();