Fix unit tests.
Only require autoloader in uninstall if WooCommerce Admin class hasn't been loaded.
This commit is contained in:
parent
4b1ccc4d15
commit
ee56177896
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue