Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/07/2015 12:35:06 PM (10 years ago)
Author:
netweb
Message:

Add support for BuddyPress PHPUnit test integration

  • Bootstrap and load /src/bbpress.php when loading the test environment
  • Detect and load BuddyPress when running the BuddyPress PHPUnit tests
  • Setup BP_UnitTest_Factory in BBP_UnitTestCase during new BuddyPress PHPUnit test integration
  • Bootstrap and load new factory class BBP_UnitTest_Factory_For_Forum for creating forums

Props boonebgorges. See #2782

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/bootstrap.php

    r5610 r5673  
    2222 */
    2323function _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
    2434    require( BBP_TESTS_DIR . '/includes/loader.php' );
    2535}
     
    3141echo "Loading bbPress testcase...\n";
    3242require( BBP_TESTS_DIR . '/includes/testcase.php' );
     43require( BBP_TESTS_DIR . '/includes/factory.php' );
     44
     45if ( defined( 'BBP_TESTS_BUDDYPRESS' ) ) {
     46    echo "Loading BuddyPress testcase...\n";
     47    require BP_TESTS_DIR . '/includes/testcase.php';
     48} else {
     49    echo "Not running BuddyPress tests. To execute these, use --group buddypress\n";
     50}
Note: See TracChangeset for help on using the changeset viewer.