Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/11/2013 06:58:12 PM (12 years ago)
Author:
boonebgorges
Message:

Improve compatibility with develop.svn.wordpress.org unit test suite

This changeset ensures that the BP tests can be run from within a
develop.svn.wordpress.org setup. Backward compatibility for custom locations
using the WP_TESTS_DIR environment variable is maintained.

Fixes #5200

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/bootstrap.php

    r6997 r7421  
    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}
     24
     25if ( ! file_exists( WP_TESTS_DIR . '/includes/functions.php' ) )
     26    die( 'The WordPress PHPUnit test suite could not be found.' );
     27
     28require_once WP_TESTS_DIR . '/includes/functions.php';
    1029
    1130function _install_and_load_buddypress() {
     
    1433tests_add_filter( 'muplugins_loaded', '_install_and_load_buddypress' );
    1534
    16 require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
     35require WP_TESTS_DIR . '/includes/bootstrap.php';
    1736
    1837// Load the BP-specific testing tools
Note: See TracChangeset for help on using the changeset viewer.