Files
old-new-wiaas/backend/app/plugins/wiaas/tests/bootstrap.php

44 lines
1.4 KiB
PHP
Raw Normal View History

2018-08-06 17:36:57 +02:00
<?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/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';
}