Merge pull request #12943 from woocommerce/fix-unit-tests-bootstrap
Fixed compatibility with 4.7 in tests bootstrap
This commit is contained in:
commit
086ed58084
|
@ -69,17 +69,22 @@ class WC_Unit_Tests_Bootstrap {
|
|||
*/
|
||||
public function install_wc() {
|
||||
|
||||
// clean existing install first
|
||||
// Clean existing install first.
|
||||
define( 'WP_UNINSTALL_PLUGIN', true );
|
||||
define( 'WC_REMOVE_ALL_DATA', true );
|
||||
include( $this->plugin_dir . '/uninstall.php' );
|
||||
|
||||
WC_Install::install();
|
||||
|
||||
// reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
|
||||
$GLOBALS['wp_roles']->reinit();
|
||||
// Reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
|
||||
if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) {
|
||||
$GLOBALS['wp_roles']->reinit();
|
||||
} else {
|
||||
$GLOBALS['wp_roles'] = null;
|
||||
wp_roles();
|
||||
}
|
||||
|
||||
echo "Installing WooCommerce..." . PHP_EOL;
|
||||
echo 'Installing WooCommerce...' . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue