five-for-the-future/plugins/wporg-5ftf/tests/bootstrap.php
Kelly Dwan 03949905c0
Tests: Update infrastructure & add travis config (#100)
* Tests: Move tests infrastructure, set up travis

Consolidates the composer files so we can run install once in travis.

* Return empty array if no values are $_POST'ed to the form

Fixes an issue with tests + null values in logs

* Clean up some naming & create helper functions for tests

* Debug travis

* Remove debug

* Fix notices on form

* Turn on multisite flag
2019-11-15 17:40:53 -05:00

30 lines
839 B
PHP
Executable file

<?php
/**
* PHPUnit bootstrap file
*/
$_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
exit( 1 );
}
// Give access to tests_add_filter() function.
require_once $_tests_dir . '/includes/functions.php';
/**
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/index.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';