Fix unit tests.

Only require autoloader in uninstall if WooCommerce Admin class hasn't been loaded.
This commit is contained in:
Jeff Stieler 2020-01-17 10:32:17 -07:00
parent 4b1ccc4d15
commit ee56177896
1 changed files with 5 additions and 3 deletions

View File

@ -30,11 +30,13 @@ if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) {
* Load core packages autoloader.
*/
if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) {
if ( ! class_exists( 'Automattic\WooCommerce\Admin\Install' ) ) {
require __DIR__ . '/src/Autoloader.php';
if ( ! \Automattic\WooCommerce\Autoloader::init() ) {
return;
}
}
// Hook in WooCommerce Admin installation code.
// @todo an alternate way to do this is allow FeaturePlugin::has_satisfied_dependencies()