diff --git a/plugins/woocommerce-admin/bin/install-wp-tests.sh b/plugins/woocommerce-admin/bin/install-wp-tests.sh index 2f4867f336e..b88529cd819 100755 --- a/plugins/woocommerce-admin/bin/install-wp-tests.sh +++ b/plugins/woocommerce-admin/bin/install-wp-tests.sh @@ -168,8 +168,12 @@ install_deps() { php wp-cli.phar core config --dbname=$DB_NAME --dbuser=$DB_USER --dbpass=$DB_PASS --dbhost=$DB_HOST --dbprefix=wptests_ php wp-cli.phar core install --url="$WP_SITE_URL" --title="Example" --admin_user=admin --admin_password=password --admin_email=info@example.com --path=$WP_CORE_DIR --skip-email - # Install Gutenberg - php wp-cli.phar plugin install gutenberg --activate + # Install Gutenberg if WP < 5 + if [[ $WP_VERSION =~ ^([0-9]+)[0-9\.]+\-? ]]; then + if [ "5" -gt "${BASH_REMATCH[1]}" ]; then + php wp-cli.phar plugin install gutenberg --activate + fi + fi # Install WooCommerce cd "wp-content/plugins/" diff --git a/plugins/woocommerce-admin/tests/bootstrap.php b/plugins/woocommerce-admin/tests/bootstrap.php index 616c248cb18..bc8866a4c6b 100755 --- a/plugins/woocommerce-admin/tests/bootstrap.php +++ b/plugins/woocommerce-admin/tests/bootstrap.php @@ -94,7 +94,9 @@ function wc_test_includes() { * Manually load the plugin being tested. */ function _manually_load_plugin() { - require dirname( dirname( dirname( __FILE__ ) ) ) . '/gutenberg/gutenberg.php'; + if ( version_compare( $GLOBALS['wp_version'], '4.9.9', '<=' ) ) { // < 5.0 fails for "5.0-alpha-12345-src + require dirname( dirname( dirname( __FILE__ ) ) ) . '/gutenberg/gutenberg.php'; + } define( 'WC_TAX_ROUNDING_MODE', 'auto' ); define( 'WC_USE_TRANSACTIONS', false );