[wp-trac] [WordPress Trac] #32702: Unit tests should set `$_SERVER['SERVER_NAME']` for `wp_mail()`

WordPress Trac noreply at wordpress.org
Thu Jun 18 13:36:02 UTC 2015


#32702: Unit tests should set `$_SERVER['SERVER_NAME']` for `wp_mail()`
--------------------------+-----------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.3
Component:  Mail          |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------
 When a test calls `wp_mail()` (directly or indirectly), and when that call
 to `wp_mail()` doesn't include an explicit From header, `wp_mail()`
 attempts to concatenate a From email out of `$_SERVER['SERVER_NAME']`. But
 when running PHPUnit, this variable is not set. Ideally, we'd only fake
 the SERVER_NAME when `wp_mail()` requires it, though I don't think there'd
 be any harm in faking it for every test (it's only used in WP when sending
 mail).

 The tests specific to `wp_mail()` already do this.

 See [32820].

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32702>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list