File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed
lib/internal/Magento/Framework/Mail Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \Framework \Mail ;
9
9
10
10
/**
11
- * Class MailAddress
11
+ * Class Address
12
12
*/
13
13
class Address
14
14
{
@@ -23,7 +23,7 @@ class Address
23
23
private $ email ;
24
24
25
25
/**
26
- * MailAddress constructor
26
+ * Address constructor
27
27
*
28
28
* @param string|null $email
29
29
* @param string|null $name
@@ -49,9 +49,9 @@ public function getName(): ?string
49
49
/**
50
50
* Email getter
51
51
*
52
- * @return string
52
+ * @return string|null
53
53
*/
54
- public function getEmail (): string
54
+ public function getEmail (): ? string
55
55
{
56
56
return $ this ->email ;
57
57
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Framework \Mail \Test \Unit ;
7
+
8
+ use Magento \Framework \Mail \Address ;
9
+ use PHPUnit \Framework \TestCase ;
10
+
11
+ /**
12
+ * test Magento\Framework\Mail\Address
13
+ */
14
+ class AddressTest extends TestCase
15
+ {
16
+ /**
17
+ * @var Address
18
+ */
19
+ protected $ message ;
20
+
21
+ /**
22
+ * Address object with nullable email parameter passed should not throw an exception.
23
+ *
24
+ * @return void
25
+ */
26
+ public function testGetEmailEmpty ()
27
+ {
28
+ $ address = new Address (null , "Test name " );
29
+ $ this ->assertNull ($ address ->getEmail ());
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments