@@ -17,34 +17,6 @@ function test_mailer_is_a_mailer_instance() {
1717 $ this ->assertTrue ( $ this ->mailer instanceof \PHPMailer );
1818 }
1919
20- function test_recipients_list () {
21-
22- $ this ->mailer ->addAddress ('abc@xyz.com ' , 'abc ' );
23- $ this ->mailer ->addAddress ('def@xyz.com ' , 'def ' );
24- $ this ->mailer ->addAddress ('noname@xyz.com ' );
25- $ prepared_list = array (
26- array (
27- 'address ' => array (
28- 'email ' => 'abc@xyz.com ' ,
29- 'name ' => 'abc ' ,
30- )
31- ),
32- array (
33- 'address ' => array (
34- 'name ' => 'def ' ,
35- 'email ' => 'def@xyz.com '
36- )
37- ),
38- array (
39- 'address ' => array (
40- 'email ' => 'noname@xyz.com ' ,
41- 'name ' => ''
42- )
43- )
44- );
45- $ this ->assertTrue (NSA ::invokeMethod ($ this ->mailer , 'get_recipients ' ) == $ prepared_list );
46- }
47-
4820 function test_sender_with_name () {
4921 $ this ->mailer ->setFrom ( 'me@hello.com ' , 'me ' );
5022 $ sender = array (
@@ -140,7 +112,7 @@ function test_get_recipients() {
140112 $ this ->mailer ->addBcc ('bcc@abc.com ' );
141113 $ this ->mailer ->addBcc ('bcc1@abc.com ' , 'bcc1 ' );
142114
143- $ header_to = implode (', ' , [
115+ $ header_to = implode (', ' , [
144116 'to@abc.com ' ,
145117 'to1 <to1@abc.com> ' ,
146118 ]);
@@ -149,13 +121,13 @@ function test_get_recipients() {
149121 [
150122 'address ' => [
151123 'email ' => 'to@abc.com ' ,
152- 'name ' => ''
124+ 'header_to ' => $ header_to
153125 ]
154126 ],
155127 [
156128 'address ' => [
157129 'email ' => 'to1@abc.com ' ,
158- 'name ' => ' to1 '
130+ 'header_to ' => $ header_to
159131 ]
160132 ],
161133 [
@@ -184,6 +156,7 @@ function test_get_recipients() {
184156 ]
185157 ];
186158
187- $ this ->assertTrue (NSA ::invokeMethod ($ this ->mailer , 'get_recipients ' ) == $ expected );
159+ $ recipients = NSA ::invokeMethod ($ this ->mailer , 'get_recipients ' );
160+ $ this ->assertTrue ($ recipients == $ expected );
188161 }
189162}
0 commit comments