Ticket #28618: 28618.diff
| File 28618.diff, 1.8 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/pluggable.php
265 265 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 266 266 require_once ABSPATH . WPINC . '/class-smtp.php'; 267 267 $phpmailer = new PHPMailer( true ); 268 /** 269 * Filters the PHPMailer object. 270 * 271 * Allows plugins to override the PHPMailer class with one of their own if required. 272 * 273 * @since 4.0 274 * 275 * @param object $phpmailer A PHPMailer (or compatible) class. 276 */ 277 $phpmailer = apply_filters( 'wp_phpmailer', $phpmailer ); 268 278 } 269 279 270 280 // Headers -
tests/phpunit/includes/bootstrap.php
45 45 $multisite = false; 46 46 } 47 47 48 // Override the PHPMailer 48 // Override the PHPMailer up front 49 49 require_once( dirname( __FILE__ ) . '/mock-mailer.php' ); 50 50 $phpmailer = new MockPHPMailer(); 51 51 … … 67 67 68 68 require_once dirname( __FILE__ ) . '/functions.php'; 69 69 70 // Ensure that PHPMailer is alwways a MockPHPMailer 71 tests_add_filter( 'wp_phpmailer', '_wp_phpmailer' ); 72 70 73 $GLOBALS['_wp_die_disabled'] = false; 71 74 // Allow tests to override wp_die 72 75 tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter' ); -
tests/phpunit/includes/functions.php
102 102 echo "\t $k : $v\n"; 103 103 } 104 104 } 105 } 106 No newline at end of file 105 } 106 107 function _wp_phpmailer( $phpmailer ) { 108 return new MockPHPMailer(); 109 }