999 | | function test_wp_new_user_notification_old_signature_throws_deprecated_warning() { |
1000 | | wp_new_user_notification( self::$author_id, 'this_is_deprecated' ); |
| 999 | function test_wp_new_user_notification_old_signature_throws_deprecated_warning_but_sends() { |
| 1000 | unset( $GLOBALS['phpmailer']->mock_sent ); |
| 1001 | |
| 1002 | $was_admin_email_sent = false; |
| 1003 | $was_user_email_sent = false; |
| 1004 | wp_new_user_notification( self::$contrib_id, 'this_is_a_test_password' ); |
| 1005 | |
| 1006 | /* |
| 1007 | * Check to see if a notification email was sent to the |
| 1008 | * post author `blackburn@battlefield3.com` and and site admin `admin@example.org`. |
| 1009 | */ |
| 1010 | if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { |
| 1011 | $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); |
| 1012 | $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] ); |
| 1013 | } |
| 1014 | |
| 1015 | $this->assertTrue( $was_admin_email_sent ); |
| 1016 | $this->assertTrue( $was_user_email_sent ); |
| 1017 | } |
| 1018 | |
| 1019 | /** |
| 1020 | * Set up a user and try sending a notification using `wp_new_user_notification( $user );`. |
| 1021 | * |
| 1022 | * @ticket 34377 |
| 1023 | */ |
| 1024 | function test_wp_new_user_notification_old_signature_no_password() { |
| 1025 | unset( $GLOBALS['phpmailer']->mock_sent ); |
| 1026 | |
| 1027 | $was_admin_email_sent = false; |
| 1028 | $was_user_email_sent = false; |
| 1029 | wp_new_user_notification( self::$contrib_id ); |
| 1030 | |
| 1031 | /* |
| 1032 | * Check to see if a notification email was sent to the |
| 1033 | * post author `blackburn@battlefield3.com` and and site admin `admin@example.org`. |
| 1034 | */ |
| 1035 | if ( ! empty( $GLOBALS['phpmailer']->mock_sent ) ) { |
| 1036 | $was_admin_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[0] ) && WP_TESTS_EMAIL == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ); |
| 1037 | $was_user_email_sent = ( isset( $GLOBALS['phpmailer']->mock_sent[1] ) && 'blackburn@battlefield3.com' == $GLOBALS['phpmailer']->mock_sent[1]['to'][0][0] ); |
| 1038 | } |
| 1039 | |
| 1040 | $this->assertTrue( $was_admin_email_sent ); |
| 1041 | $this->assertFalse( $was_user_email_sent ); |