1
0
mirror of synced 2025-03-20 15:13:56 +03:00

[fix] Tests compatibility with changes in current woocommerce master

This commit is contained in:
Pavel 2020-05-27 11:51:56 +03:00 committed by GitHub
parent eef81f506b
commit d0dfc39da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
<?php
$_tests_dir = getenv('WP_TESTS_DIR');
$_wcOldBootstrap = '/tmp/woocommerce/tests/bootstrap.php';
$_wcNewBootstrap = '/tmp/woocommerce/tests/legacy/bootstrap.php';
if (!$_tests_dir) {
$_tests_dir = '/tmp/wordpress-tests-lib';
@ -23,7 +25,11 @@ function _manually_load_plugin() {
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
require '/tmp/woocommerce/tests/bootstrap.php';
if (file_exists($_wcOldBootstrap)) {
require $_wcOldBootstrap;
} elseif (file_exists($_wcNewBootstrap)) {
require $_wcNewBootstrap;
}
$plugin_dir = dirname(dirname(__FILE__)) . '/';
// helpers