WordPress.org

Make WordPress Core

Changeset 439 in tests


Ignore:
Timestamp:
09/19/11 14:16:33 (3 years ago)
Author:
westi
Message:

Add a testcase for #WP18463 - wp_mail called with an address like <address@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_pluggable.php

    r407 r439  
    219219        unset( $_SERVER['SERVER_NAME'] ); 
    220220    } 
     221 
     222    function test_wp_mail_to_address_no_name() { 
     223        $this->knownWPBug( 18463 ); 
     224 
     225        $to = "<address@tld.com>"; 
     226        $subject = "RFC2822 Testing"; 
     227        $message = "My RFC822 Test Message"; 
     228 
     229        unset($GLOBALS['phpmailer']->mock_sent); 
     230        $_SERVER['SERVER_NAME'] = 'example.com'; 
     231        wp_mail( $to, $subject, $message ); 
     232 
     233        $this->assertEquals('<address@tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); 
     234        $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); 
     235        unset( $_SERVER['SERVER_NAME'] ); 
     236    } 
    221237} 
    222238 
Note: See TracChangeset for help on using the changeset viewer.