WordPress.org

Make WordPress Core

Changeset 1301 in tests


Ignore:
Timestamp:
06/29/13 22:53:42 (13 months ago)
Author:
SergeyBiryukov
Message:

Test for wp_mail() return value. props iandunn. see #23642.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/mail.php

    r1300 r1301  
    210210        unset( $_SERVER['SERVER_NAME'] ); 
    211211    } 
     212 
     213    /** 
     214     * @ticket 23642 
     215     */ 
     216    function test_wp_mail_return_value() { 
     217        // No errors 
     218        $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body' ) ); 
     219 
     220        // Non-fatal errors 
     221        $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . '/non-existant-file.html' ) ); 
     222 
     223        // Fatal errors 
     224        $this->assertFalse( wp_mail( 'invalid.address', 'subject', 'body', '', array() ) ); 
     225    } 
    212226} 
Note: See TracChangeset for help on using the changeset viewer.