[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/tests/phpunit/ -> bootstrap.php (source)

   1  <?php
   2  
   3  // Define our constants
   4  echo "Defining constants...\n";
   5  require( dirname( __FILE__ ) . '/includes/define-constants.php' );
   6  
   7  echo "Ensure bbPress is an active plugin...\n";
   8  $GLOBALS['wp_tests_options'] = array(
   9      'active_plugins' => array( 'bbpress/bbpress.php' ),
  10  );
  11  
  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  
  20  /**
  21   * Load the bbPress/PHPUnit test-suite loader
  22   */
  23  function _load_loader() {
  24  
  25      // Check if we're running the BuddyPress test suite
  26      if ( defined( 'BBP_TESTS_BUDDYPRESS' ) ) {
  27  
  28          // If BuddyPress is found, set it up and require it.
  29          if ( defined( 'BP_TESTS_DIR' ) ) {
  30              require  BP_TESTS_DIR . '/includes/loader.php';
  31          }
  32      }
  33  
  34      require ( BBP_TESTS_DIR . '/includes/loader.php' );
  35  }
  36  tests_add_filter( 'muplugins_loaded', '_load_loader' );
  37  
  38  echo "Loading WordPress bootstrap...\n";
  39  require( WP_TESTS_DIR . '/includes/bootstrap.php' );
  40  
  41  echo "Loading bbPress testcase...\n";
  42  require ( BBP_TESTS_DIR . '/includes/testcase.php' );
  43  require ( BBP_TESTS_DIR . '/includes/factory.php' );
  44  
  45  if ( defined( 'BBP_TESTS_BUDDYPRESS' ) ) {
  46      echo "Loading BuddyPress testcase...\n";
  47      if ( defined( 'BP_TESTS_DIR' ) ) {
  48          require ( BP_TESTS_DIR . '/includes/testcase.php' );
  49      }
  50  } else {
  51      echo "Not running BuddyPress tests. To execute these, use -c tests/phpunit/buddypress.xml\n";
  52  }


Generated: Thu Apr 25 01:01:05 2024 Cross-referenced by PHPXref 0.7.1