49 lines
1.5 KiB
PHP
49 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* PHPUnit bootstrap file for Wiaas plugin
|
|
*
|
|
* @package Wiaas
|
|
*/
|
|
|
|
|
|
# Folder where wordpress testing library is installed
|
|
$_tests_dir = '/tmp/wordpress-tests-lib';
|
|
|
|
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
|
|
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/setup.sh ?" . PHP_EOL;
|
|
exit( 1 );
|
|
}
|
|
|
|
# Give access to tests_add_filter() function.
|
|
require_once $_tests_dir . '/includes/functions.php';
|
|
|
|
#load setup
|
|
tests_add_filter( 'muplugins_loaded', 'load_wiaas_test_setup' );
|
|
|
|
# Start up the WP testing environment.
|
|
require $_tests_dir . '/includes/bootstrap.php';
|
|
|
|
# Require Wiaas Unit Test case class
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/wiaas/tests/wiaas-unit-test-case.php';
|
|
|
|
function load_wiaas_test_setup() {
|
|
|
|
# Activate plugins needed for testing
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/woocommerce/woocommerce.php';
|
|
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/gravityforms/gravityforms.php';
|
|
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/gravityflow/gravityflow.php';
|
|
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/groups/groups.php';
|
|
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/wp-user-groups/wp-user-groups.php';
|
|
_wp_user_groups();
|
|
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/wiaas/wiaas.php';
|
|
|
|
# Require classes needed for db updates
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/wiaas/includes/class-wiaas-db-update.php';
|
|
require_once '/tmp/wiaas-backend-test/app/plugins/wiaas/includes/db-updates/wiaas-db-update-functions.php';
|
|
}
|