Changeset 38058 for trunk/tests/phpunit/tests/mail.php
- Timestamp:
- 07/13/2016 06:03:52 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/mail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/mail.php
r37358 r38058 308 308 $this->assertNotContains( 'quoted-printable', $GLOBALS['phpmailer']->mock_sent[0]['header'] ); 309 309 } 310 311 /** 312 * @ticket 21659 313 */ 314 public function test_wp_mail_addresses_arent_encoded() { 315 $to = 'Lukáš To <to@example.org>'; 316 $subject = 'Testing #21659'; 317 $message = 'Only the name should be encoded, not the address.'; 318 319 $headers = array( 320 'From' => 'From: Lukáš From <from@example.org>', 321 'Cc' => 'Cc: Lukáš CC <cc@example.org>', 322 'Bcc' => 'Bcc: Lukáš BCC <bcc@example.org>', 323 'Reply-To' => 'Reply-To: Lukáš Reply-To <reply_to@example.org>', 324 ); 325 326 $expected = array( 327 'To' => 'To: =?UTF-8?B?THVrw6HFoSBUbw==?= <to@example.org>', 328 'From' => 'From: =?UTF-8?Q?Luk=C3=A1=C5=A1_From?= <from@example.org>', 329 'Cc' => 'Cc: =?UTF-8?B?THVrw6HFoSBDQw==?= <cc@example.org>', 330 'Bcc' => 'Bcc: =?UTF-8?B?THVrw6HFoSBCQ0M=?= <bcc@example.org>', 331 'Reply-To' => 'Reply-To: =?UTF-8?Q?Luk=C3=A1=C5=A1_Reply-To?= <reply_to@example.org>', 332 ); 333 334 wp_mail( $to, $subject, $message, array_values( $headers ) ); 335 336 $mailer = tests_retrieve_phpmailer_instance(); 337 $sent_headers = preg_split( "/\r\n|\n|\r/", $mailer->get_sent()->header ); 338 $headers['To'] = "To: $to"; 339 340 foreach ( $headers as $header => $value ) { 341 $target_headers = preg_grep( "/^$header:/", $sent_headers ); 342 $this->assertEquals( $expected[ $header ], array_pop( $target_headers ) ); 343 } 344 } 310 345 }
Note: See TracChangeset
for help on using the changeset viewer.