@@ -28,15 +28,21 @@ public function testConstructorWithAddressSender()
28
28
public function testConstructorWithNamedAddressSender ()
29
29
{
30
30
$ e = new SmtpEnvelope (new Address ('fabien@symfony.com ' , 'Fabien ' ), [new Address ('thomas@symfony.com ' )]);
31
- $ this ->assertEquals (new Address ('fabien@symfony.com ' ), $ e ->getSender ());
31
+ $ this ->assertEquals (new Address ('fabien@symfony.com ' , ' Fabien ' ), $ e ->getSender ());
32
32
}
33
33
34
34
public function testConstructorWithAddressRecipients ()
35
35
{
36
- $ e = new SmtpEnvelope (new Address ('fabien@symfony.com ' ), [new Address ('thomas@symfony.com ' ), new Address ('lucas@symfony.com ' , ' Lucas ' )]);
36
+ $ e = new SmtpEnvelope (new Address ('fabien@symfony.com ' ), [new Address ('thomas@symfony.com ' ), new Address ('lucas@symfony.com ' )]);
37
37
$ this ->assertEquals ([new Address ('thomas@symfony.com ' ), new Address ('lucas@symfony.com ' )], $ e ->getRecipients ());
38
38
}
39
39
40
+ public function testConstructorWithNamedAddressRecipients ()
41
+ {
42
+ $ e = new SmtpEnvelope (new Address ('fabien@symfony.com ' ), [new Address ('thomas@symfony.com ' , 'Thomas ' ), new Address ('lucas@symfony.com ' , 'Lucas ' )]);
43
+ $ this ->assertEquals ([new Address ('thomas@symfony.com ' , 'Thomas ' ), new Address ('lucas@symfony.com ' , 'Lucas ' )], $ e ->getRecipients ());
44
+ }
45
+
40
46
public function testConstructorWithNoRecipients ()
41
47
{
42
48
$ this ->expectException (\InvalidArgumentException::class);
@@ -55,7 +61,7 @@ public function testSenderFromHeaders()
55
61
$ headers ->addPathHeader ('Return-Path ' , new Address ('return@symfony.com ' , 'return ' ));
56
62
$ headers ->addMailboxListHeader ('To ' , ['from@symfony.com ' ]);
57
63
$ e = SmtpEnvelope::create (new Message ($ headers ));
58
- $ this ->assertEquals ('return@symfony.com ' , $ e ->getSender ()-> getAddress ());
64
+ $ this ->assertEquals (new Address ( 'return@symfony.com ' , ' return ' ), $ e ->getSender ());
59
65
60
66
$ headers = new Headers ();
61
67
$ headers ->addMailboxHeader ('Sender ' , new Address ('sender@symfony.com ' , 'sender ' ));
@@ -87,6 +93,6 @@ public function testRecipientsFromHeaders()
87
93
$ headers ->addMailboxListHeader ('Cc ' , [new Address ('cc@symfony.com ' , 'cc ' )]);
88
94
$ headers ->addMailboxListHeader ('Bcc ' , [new Address ('bcc@symfony.com ' , 'bcc ' )]);
89
95
$ e = SmtpEnvelope::create (new Message ($ headers ));
90
- $ this ->assertEquals ([new Address ('to@symfony.com ' ), new Address ('cc@symfony.com ' ), new Address ('bcc@symfony.com ' )], $ e ->getRecipients ());
96
+ $ this ->assertEquals ([new Address ('to@symfony.com ' , ' to ' ), new Address ('cc@symfony.com ' , ' cc ' ), new Address ('bcc@symfony.com ' , ' bcc ' )], $ e ->getRecipients ());
91
97
}
92
98
}
0 commit comments