Skip to:
Content

BuddyPress.org

Ticket #5200: 5200.diff

File 5200.diff, 2.8 KB (added by ericlewis, 12 years ago)
  • tests/bootstrap.php

     
    66        define( 'BP_TESTS_DIR', dirname( __FILE__ ) . '/' );
    77}
    88
    9 require_once getenv( 'WP_TESTS_DIR' ) . '/includes/functions.php';
     9/**
     10 * In the pre-develop.svn WP development environment, an environmental bash
     11 * variable would be set to run PHP Unit tests. However, this has been done
     12 * away with in a post-develop.svn world. We'll still check if this variable
     13 * is set for backwards compat.
     14 */
     15if ( getenv( 'WP_TESTS_DIR' ) ) {
     16        define( 'WP_TESTS_DIR', getenv( 'WP_TESTS_DIR' ) );
     17        define( 'WP_TESTS_CONFIG_PATH', WP_TESTS_DIR . '/wp-tests-config.php' );
     18}
     19else {
     20        define( 'WP_ROOT_DIR', dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) );
     21        define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' );
     22        define( 'WP_TESTS_CONFIG_PATH', WP_ROOT_DIR . '/wp-tests-config.php' );
     23}
     24require_once WP_TESTS_DIR . '/includes/functions.php';
    1025
    1126function _install_and_load_buddypress() {
    1227        require BP_TESTS_DIR . '/includes/loader.php';
    1328}
    1429tests_add_filter( 'muplugins_loaded', '_install_and_load_buddypress' );
    1530
    16 require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
     31require WP_TESTS_DIR . '/includes/bootstrap.php';
    1732
    1833// Load the BP-specific testing tools
    1934require BP_TESTS_DIR . '/includes/testcase.php';
  • tests/includes/install.php

     
    88error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
    99
    1010$config_file_path = $argv[1];
    11 $multisite = ! empty( $argv[2] );
     11$tests_dir_path = $argv[2];
     12$multisite = ! empty( $argv[3] );
    1213
    1314require_once $config_file_path;
    14 require_once dirname( $config_file_path ) . '/includes/functions.php';
     15require_once $tests_dir_path . '/includes/functions.php';
    1516
    1617function _load_buddypress() {
    1718        require dirname( dirname( dirname( __FILE__ ) ) ) . '/bp-loader.php';
  • tests/includes/loader.php

     
    11<?php
    2 
    3 // Install BP
    4 $config_file_path = getenv( 'WP_TESTS_DIR' ) . '/wp-tests-config.php';
    52$multisite = (int) ( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE );
    6 system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite );
     3system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( WP_TESTS_CONFIG_PATH ) . ' ' . escapeshellarg( WP_TESTS_DIR ) . ' ' . $multisite );
    74
    85// Bootstrap BP
    96require dirname( __FILE__ ) . '/../../bp-loader.php';