Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/21/2016 04:11:11 PM (4 years ago)
Author:
djpaul
Message:

Emails: add a test to check sending works in the test environment.

The delivery class is already mocked, so no actual emails will be sent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/class-bp-email.php

    r10541 r10668  
    251251        $this->assertSame( $new_recipient, $addresses[1]->get_address() );
    252252    }
     253
     254    public function test_sending_email() {
     255        $user1  = get_user_by( 'id', $this->u1 );
     256        $result = bp_send_email( 'core-user-registration', $this->u1, array(
     257            'tokens' => array(
     258                'activate.url' => 'http://example.com',
     259                'key'          => '123',
     260                'user.email'   => $user1->user_email,
     261                'user.id'      => $this->u1,
     262            ),
     263        ) );
     264
     265        $this->assertTrue( $result );
     266    }
    253267}
Note: See TracChangeset for help on using the changeset viewer.