Changeset 54529 for trunk/tests/phpunit/tests/mail.php
- Timestamp:
- 10/17/2022 11:40:36 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/mail.php
r53900 r54529 476 476 $this->assertFalse( $result2 ); 477 477 } 478 479 /** 480 * Tests that AltBody is reset between each wp_mail call. 481 * 482 * @covers :wp_mail 483 */ 484 public function test_wp_mail_resets_properties() { 485 $wp_mail_set_text_message = function ( $phpmailer ) { 486 $phpmailer->AltBody = 'user1'; 487 }; 488 add_action( 'phpmailer_init', $wp_mail_set_text_message ); 489 wp_mail( 'user1@example.localhost', 'Test 1', '<p>demo</p>', 'Content-Type: text/html' ); 490 remove_action( 'phpmailer_init', $wp_mail_set_text_message ); 491 wp_mail( 'user2@example.localhost', 'Test 2', 'test2' ); 492 $phpmailer = $GLOBALS['phpmailer']; 493 $this->assertNotSame( 'user1', $phpmailer->AltBody ); 494 } 478 495 }
Note: See TracChangeset
for help on using the changeset viewer.