Changeset 35350 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 10/21/2015 11:51:45 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/testcase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r35309 r35350 111 111 $this->expectDeprecated(); 112 112 add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 113 114 add_filter( 'wp_mail', array( $this, 'set_wp_mail_globals' ) );115 113 } 116 114 … … 670 668 671 669 /** 672 * When `wp_mail()` is called, make sure `$_SERVER['SERVER_NAME']` is faked.673 *674 * @since 4.3.0675 *676 * @param array $args `wp_mail()` arguments.677 * @return array $args678 */679 public function set_wp_mail_globals( $args ) {680 if ( ! isset( $_SERVER['SERVER_NAME'] ) ) {681 $_SERVER['SERVER_NAME'] = 'example.com';682 add_action( 'phpmailer_init', array( $this, 'tear_down_wp_mail_globals' ) );683 }684 685 return $args;686 }687 688 /**689 * Tear down the faked `$_SERVER['SERVER_NAME']` global used in `wp_mail()`.690 *691 * @since 4.3.0692 */693 public function tear_down_wp_mail_globals() {694 unset( $_SERVER['SERVER_NAME'] );695 }696 697 /**698 670 * Multisite-agnostic way to delete a user from the database. 699 671 *
Note: See TracChangeset
for help on using the changeset viewer.