diff --git a/plugins/woocommerce/changelog/fix-hpos-unit-test-trait b/plugins/woocommerce/changelog/fix-hpos-unit-test-trait new file mode 100644 index 00000000000..863e64c0279 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-hpos-unit-test-trait @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +add HPOSToggleTrait.php to unit test loader diff --git a/plugins/woocommerce/tests/legacy/bootstrap.php b/plugins/woocommerce/tests/legacy/bootstrap.php index 273c943e31d..5b0c9363807 100644 --- a/plugins/woocommerce/tests/legacy/bootstrap.php +++ b/plugins/woocommerce/tests/legacy/bootstrap.php @@ -264,6 +264,7 @@ class WC_Unit_Tests_Bootstrap { // Traits. require_once $this->tests_dir . '/framework/traits/trait-wc-rest-api-complex-meta.php'; + require_once dirname( $this->tests_dir ) . '/php/helpers/HPOSToggleTrait.php'; } /** diff --git a/plugins/woocommerce/tests/php/helpers/HPOSToggleTrait.php b/plugins/woocommerce/tests/php/helpers/HPOSToggleTrait.php index 4531a3eb28d..0915542c914 100644 --- a/plugins/woocommerce/tests/php/helpers/HPOSToggleTrait.php +++ b/plugins/woocommerce/tests/php/helpers/HPOSToggleTrait.php @@ -2,12 +2,8 @@ namespace Automattic\WooCommerce\RestApi\UnitTests; -use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; -use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore; -use Automattic\WooCommerce\Internal\Features\FeaturesController; use Automattic\WooCommerce\RestApi\UnitTests\Helpers\OrderHelper; -use WC_Data_Store; /** * Trait HPOSToggleTrait. diff --git a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php index 23bcd9e8483..b3aa6c9184e 100644 --- a/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php +++ b/plugins/woocommerce/tests/php/src/Internal/DataStores/Orders/OrdersTableDataStoreTests.php @@ -9,8 +9,6 @@ use Automattic\WooCommerce\RestApi\UnitTests\Helpers\OrderHelper; use Automattic\WooCommerce\RestApi\UnitTests\HPOSToggleTrait; use Automattic\WooCommerce\Utilities\OrderUtil; -require_once __DIR__ . '/../../../../helpers/HPOSToggleTrait.php'; - /** * Class OrdersTableDataStoreTests. *