Skip to:
Content

BuddyPress.org

Changeset 9981


Ignore:
Timestamp:
06/30/2015 01:25:53 AM (5 years ago)
Author:
boonebgorges
Message:

In automated tests, generate page mappings in BP_UnitTestCase::setUpBeforeClass().

Calling this function in the global scope meant that it was difficult to load
the file in the context of third-party plugins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase.php

    r9980 r9981  
    11<?php
    2 
    3 /**
    4  * WP's test suite wipes out BP's directory page mappings with _delete_all_posts()
    5  * We must reestablish them before our tests can be successfully run
    6  */
    7 bp_core_add_page_mappings( bp_get_option( 'bp-active-components' ), 'delete' );
    82
    93require_once dirname( __FILE__ ) . '/factory.php';
     
    2418
    2519    public static function setUpBeforeClass() {
     20
     21        /*
     22         * WP's test suite wipes out BP's directory page mappings with `_delete_all_posts()`.
     23         * We must reestablish them before our tests can be successfully run.
     24         */
     25        bp_core_add_page_mappings( bp_get_option( 'bp-active-components' ), 'delete' );
     26
    2627        // Fake WP mail globals, to avoid errors
    2728        add_filter( 'wp_mail', array( 'BP_UnitTestCase', 'setUp_wp_mail' ) );
Note: See TracChangeset for help on using the changeset viewer.