Changeset 5610 for trunk/tests/phpunit/bootstrap.php
- Timestamp:
- 01/30/2015 06:36:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/bootstrap.php
r5279 r5610 1 1 <?php 2 2 3 /** 4 * Bootstrap the plugin unit testing environment. 5 * 6 * Edit 'active_plugins' setting below to point to your main plugin file. 7 * 8 * @package wordpress-plugin-tests 9 */ 3 // Define our constants 4 echo "Defining constants...\n"; 5 require( dirname( __FILE__ ) . '/includes/define-constants.php' ); 10 6 11 // Activates this plugin in WordPress so it can be tested. 7 echo "Ensure bbPress is an active plugin...\n"; 12 8 $GLOBALS['wp_tests_options'] = array( 13 9 'active_plugins' => array( 'bbpress/bbpress.php' ), 14 10 ); 15 11 16 // If the develop repo location is defined (as WP_DEVELOP_DIR), use that 17 // location. Otherwise, we'll just assume that this plugin is installed in a 18 // WordPress develop SVN checkout. 12 // Bail if test suite cannot be found 13 if ( ! file_exists( WP_TESTS_DIR . '/includes/functions.php' ) ) { 14 die( "The WordPress PHPUnit test suite could not be found.\n" ); 15 } else { 16 echo "Loading WordPress PHPUnit test suite...\n"; 17 require( WP_TESTS_DIR . '/includes/functions.php' ); 18 } 19 19 20 if( false !== getenv( 'WP_DEVELOP_DIR' ) ) { 21 require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php'; 22 } else { 23 require '../../../../tests/phpunit/includes/bootstrap.php'; 20 /** 21 * Load bbPress's PHPUnit test suite loader 22 */ 23 function _load_loader() { 24 require( BBP_TESTS_DIR . '/includes/loader.php' ); 24 25 } 26 tests_add_filter( 'muplugins_loaded', '_load_loader' ); 27 28 echo "Loading WordPress bootstrap...\n"; 29 require( WP_TESTS_DIR . '/includes/bootstrap.php' ); 30 31 echo "Loading bbPress testcase...\n"; 32 require( BBP_TESTS_DIR . '/includes/testcase.php' );
Note: See TracChangeset
for help on using the changeset viewer.