[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/tests/phpunit/includes/ -> install.php (source)

   1  <?php
   2  
   3  /**
   4   * Installs bbPress for the purpose of the unit-tests
   5   */
   6  
   7  echo "Setting up WordPress test environment...\n";
   8  
   9  error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
  10  
  11  $config_file_path = $argv[1];
  12  $tests_dir_path   = $argv[2];
  13  $multisite        = ! empty( $argv[3] );
  14  
  15  // Pull in the WordPress core test suite
  16  require_once $config_file_path;
  17  require_once $tests_dir_path . '/includes/functions.php';
  18  
  19  /**
  20   * Include bbPress via `plugins_loaded` event
  21   *
  22   * This could maybe me earlier on `muplugins_loaded` but time will tell what
  23   * works best for us.
  24   */
  25  function _load_bbpress() {
  26      echo "Loading bbPress via `/src/bbpress.php`...\n";
  27      require dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/src/bbpress.php';
  28  }
  29  tests_add_filter( 'plugins_loaded', '_load_bbpress' );
  30  
  31  // Override some fussy global values
  32  $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
  33  $_SERVER['HTTP_HOST']       = WP_TESTS_DOMAIN;
  34  $_SERVER['REMOTE_ADDR']     = '127.0.0.1';
  35  
  36  // Fix PHP identity crisis
  37  $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
  38  
  39  // Include WordPress
  40  echo "Loading WordPress via `wp-settings.php`...\n";
  41  require_once ABSPATH . '/wp-settings.php';
  42  
  43  // Fix fussy database settings
  44  $wpdb->query( 'SET storage_engine = INNODB' );
  45  $wpdb->select( DB_NAME, $wpdb->dbh );
  46  
  47  // Install bbPress
  48  echo "Installing bbPress...\n";
  49  bbp_version_bump();


Generated: Sat Dec 21 01:00:52 2024 Cross-referenced by PHPXref 0.7.1