Make WordPress Core

Changeset 37277


Ignore:
Timestamp:
04/21/2016 11:51:59 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Users: Add a unit test for [37276].

See #36009.

File:
1 edited

Legend:

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

    r37059 r37277  
    10221022     * @dataProvider data_wp_new_user_notifications
    10231023     * @ticket 33654
     1024     * @ticket 36009
    10241025     */
    10251026    function test_wp_new_user_notification( $notify, $admin_email_sent_expected, $user_email_sent_expected ) {
     
    10371038         * post author `blackburn@battlefield3.com` and and site admin `admin@example.org`.
    10381039         */
    1039         $admin_email = $mailer->get_recipient( 'to' );
    1040         $was_admin_email_sent = $admin_email && WP_TESTS_EMAIL === $admin_email->address;
    1041 
    1042         $user_email = $mailer->get_recipient( 'to', 1 );
    1043         $was_user_email_sent = $user_email && 'blackburn@battlefield3.com' == $user_email->address;
     1040        $first_recipient = $mailer->get_recipient( 'to' );
     1041        if ( $first_recipient ) {
     1042            $was_admin_email_sent = WP_TESTS_EMAIL === $first_recipient->address;
     1043            $was_user_email_sent = 'blackburn@battlefield3.com' === $first_recipient->address;
     1044        }
     1045
     1046        $second_recipient = $mailer->get_recipient( 'to', 1 );
     1047        if ( $second_recipient ) {
     1048            $was_user_email_sent = 'blackburn@battlefield3.com' === $second_recipient->address;
     1049        }
    10441050
    10451051
     
    10751081            ),
    10761082            array(
     1083                'user',
     1084                false,
     1085                true,
     1086            ),
     1087            array(
    10771088                'both',
    10781089                true,
Note: See TracChangeset for help on using the changeset viewer.