File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
tests/phpunit/tests/pluggable Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -719,13 +719,6 @@ public function test_wp_mail_plain_and_html() {
719719 );
720720 }
721721
722- /*
723- * 'phpmailer_init' action for test_wp_mail_plain_and_html_workaround().
724- */
725- public function wp_mail_set_alt_body ( $ mailer ) {
726- $ mailer ->AltBody = strip_tags ( $ mailer ->Body );
727- }
728-
729722 /**
730723 * Check workarounds using phpmailer_init still work around.
731724 *
@@ -736,9 +729,12 @@ public function test_wp_mail_plain_and_html_workaround() {
736729 $ subject = 'Test email with plain text derived from html version ' ;
737730 $ message = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><p>Hello World! γειά σου Κόσμε</p></body></html> ' ;
738731
739- add_action ( 'phpmailer_init ' , array ( $ this , 'wp_mail_set_alt_body ' ) );
732+ $ set_alt_body = static function ( WP_PHPMailer $ mailer ) {
733+ $ mailer ->AltBody = strip_tags ( $ mailer ->Body );
734+ };
735+ add_action ( 'phpmailer_init ' , $ set_alt_body );
740736 wp_mail ( $ to , $ subject , $ message );
741- remove_action ( 'phpmailer_init ' , array ( $ this , ' wp_mail_set_alt_body ' ) );
737+ remove_action ( 'phpmailer_init ' , $ set_alt_body );
742738
743739 $ mailer = tests_retrieve_phpmailer_instance ();
744740
You can’t perform that action at this time.
0 commit comments