add HPOSToggleTrait.php to unit test loader (#38684)

This PR fixes two unit test files that could not be run individually by adding HPOSToggleTrait.php to the unit test boot loader. It also does a bit of namespace cleanup in HPOSToggleTrait.php.
This commit is contained in:
Corey McKrill 2023-06-14 11:03:04 -07:00 committed by GitHub
commit 9704873fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
add HPOSToggleTrait.php to unit test loader

View File

@ -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';
}
/**

View File

@ -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.

View File

@ -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.
*