Neur0toxine
804cbfac37
* corporate customers support * skip new payments without type * extract customer data from order for guests * extract customer phone and email from order for guests * set item discount to zero if no discount applies * create order from back-office * sync phone via history * fixed customer squashing * fixed createdAt crash * fixed customer id assigning & possible crash after errors in order creation
46 lines
1.7 KiB
PHP
46 lines
1.7 KiB
PHP
<?php
|
|
|
|
$_tests_dir = getenv('WP_TESTS_DIR');
|
|
$_output_logs_to_stdout = getenv('MODULE_LOGS_TO_STDOUT');
|
|
$_wcOldBootstrap = '/tmp/woocommerce/tests/bootstrap.php';
|
|
$_wcNewBootstrap = '/tmp/woocommerce/tests/legacy/bootstrap.php';
|
|
|
|
if (!$_tests_dir) {
|
|
$_tests_dir = '/tmp/wordpress-tests-lib';
|
|
}
|
|
|
|
require_once $_tests_dir . '/includes/functions.php';
|
|
|
|
function _manually_load_plugin() {
|
|
$plugin_dir = dirname(dirname(__FILE__)) . '/';
|
|
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-orders.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-customers.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-inventories.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-ga.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-daemon-collector.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-history.php';
|
|
require $plugin_dir . 'src/include/class-wc-retailcrm-icml.php';
|
|
require $plugin_dir . 'src/retailcrm.php';
|
|
}
|
|
|
|
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
|
|
|
|
if (file_exists($_wcOldBootstrap)) {
|
|
require $_wcOldBootstrap;
|
|
} elseif (file_exists($_wcNewBootstrap)) {
|
|
require $_wcNewBootstrap;
|
|
}
|
|
|
|
$plugin_dir = dirname(dirname(__FILE__)) . '/';
|
|
|
|
// helpers
|
|
require $plugin_dir . 'src/include/components/class-wc-retailcrm-logger.php';
|
|
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-response-helper.php';
|
|
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-test-case-helper.php';
|
|
require $plugin_dir . 'tests/helpers/class-wc-retailcrm-log-handler-stdout.php';
|
|
|
|
if (!empty($_output_logs_to_stdout) && $_output_logs_to_stdout == '1') {
|
|
WC_Retailcrm_Logger::setAdditionalHandlers(array(new WC_Retailcrm_Log_Handler_Stdout()));
|
|
}
|