| | 365 | * Test that the From parameter has been set in phpmailer instance and not kept default. |
| | 366 | * Even in the case when SERVER_NAME is not available. |
| | 367 | * |
| | 368 | * @ticket 40810 |
| | 369 | */ |
| | 370 | public function test_wp_mail_from_not_default() { |
| | 371 | $_SERVER['SERVER_NAME'] = ''; |
| | 372 | wp_mail( 'user@example.org', 'Testing the From field', 'The From field should not be default.' ); |
| | 373 | |
| | 374 | $mailer = tests_retrieve_phpmailer_instance(); |
| | 375 | |
| | 376 | $this->assertNotEquals( 'root@localhost', $mailer->From ); |
| | 377 | } |
| | 378 | |
| | 379 | /** |