Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2013 05:49:35 PM (11 years ago)
Author:
boonebgorges
Message:

Fake some critical globals when running unit tests that touch wp_mail()

The wp_mail() function requires access to $_SERVERSERVER_NAME?, which is
not available when running the unit tests. We follow the WordPress core test
suite, by faking this value during automated testing.

Note that the long-term solution to this issue should be to break notification
functionality out of the wrapper functions that are used to request friendship,
etc. The current fix is something of an ugly workaround, just to get the tests
running properly when using E_STRICT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/groups/functions.php

    r7469 r7497  
    226226        $u2 = $this->create_user();
    227227        $g = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     228
     229        $this->setUp_wp_mail();
    228230        groups_send_membership_request( $u2, $g );
    229 
    230231        groups_accept_membership_request( 0, $u2, $g );
     232        $this->tearDown_wp_mail();
    231233
    232234        $this->assertEquals( 2, groups_get_groupmeta( $g, 'total_member_count' ) );
Note: See TracChangeset for help on using the changeset viewer.