[fix] Tests compatibility with changes in current woocommerce master
This commit is contained in:
parent
eef81f506b
commit
d0dfc39da0
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user