Make sure $_SERVER['SERVER_NAME'] is set whenever wp_mail() is called in PHPUnit tests.

This eliminates PHP notices when `wp_mail()` needs to determine its own From header.

See [25381] for a previous fix, which focused only on the mail-specific tests.

Fixes #32702.

git-svn-id: https://develop.svn.wordpress.org/trunk@32839 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-06-18 13:52:29 +00:00
parent 7ae03917a9
commit 9597066674
2 changed files with 28 additions and 6 deletions
-6
View File
@@ -6,15 +6,9 @@
class Tests_Mail extends WP_UnitTestCase {
function setUp() {
parent::setUp();
$_SERVER['SERVER_NAME'] = 'example.com';
unset( $GLOBALS['phpmailer']->mock_sent );
}
function tearDown() {
unset( $_SERVER['SERVER_NAME'] );
parent::tearDown();
}
function test_wp_mail_custom_boundaries() {
$to = 'user@example.com';
$subject = 'Test email with custom boundaries';