mirror of
https://gh.wpcy.net/https://github.com/buddypress/buddypress.git
synced 2026-06-01 06:04:04 +08:00
BP's test installation routine is generally run from bootstrap.php. But in certain cases, as when the suite is being invoked from a BP-dependent plugin's tests, loader.php can be called directly, skipping bootstrap.php. For this reason, it makes sense to define constants in a separate file and then include that file as needed when the tests are first loaded, via either path. git-svn-id: https://buddypress.svn.wordpress.org/trunk@7665 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
19 lines
570 B
PHP
19 lines
570 B
PHP
<?php
|
|
|
|
require( dirname( __FILE__ ) . '/includes/define-constants.php' );
|
|
|
|
if ( ! file_exists( WP_TESTS_DIR . '/includes/functions.php' ) ) {
|
|
die( "The WordPress PHPUnit test suite could not be found.\n" );
|
|
}
|
|
|
|
require_once WP_TESTS_DIR . '/includes/functions.php';
|
|
|
|
function _install_and_load_buddypress() {
|
|
require BP_TESTS_DIR . '/includes/loader.php';
|
|
}
|
|
tests_add_filter( 'muplugins_loaded', '_install_and_load_buddypress' );
|
|
|
|
require WP_TESTS_DIR . '/includes/bootstrap.php';
|
|
|
|
// Load the BP-specific testing tools
|
|
require BP_TESTS_DIR . '/includes/testcase.php';
|